Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.15.0 #217

Merged
merged 36 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b6ee48e
Explicitely use NodeJS 20 in CI build
xavierfoucrier Sep 15, 2024
42789ae
♻️ refactor `sync-labels` workflow
xavierfoucrier Nov 22, 2024
29e9436
♻️ refactor `ci` workflow
xavierfoucrier Nov 22, 2024
52a161b
📦 update HtmlAgilityPack to 1.11.71
xavierfoucrier Nov 22, 2024
06fe8f3
📦 update Google.Apis.Gmail.v1 to 1.68.0.3427
xavierfoucrier Nov 22, 2024
40ff0e5
🐛 fix obsolete method
xavierfoucrier Nov 22, 2024
4adcf39
⬆️ upgrade log4net to 3.0.3
xavierfoucrier Nov 22, 2024
efa36ee
✏️ update visual studio version number
xavierfoucrier Nov 22, 2024
c92d891
🩹 fix synchronization loop
xavierfoucrier Nov 24, 2024
d97e11c
♻️ dispose cancellation when it is no longer needed
xavierfoucrier Nov 25, 2024
c2d73ad
💄 improve oauth message rendering
xavierfoucrier Nov 25, 2024
efc1946
♻️ move `ringtone` to notification class
xavierfoucrier Nov 26, 2024
9140189
✏️ fill missing comments
xavierfoucrier Nov 26, 2024
94a7102
✏️ use named parameter instead
xavierfoucrier Nov 26, 2024
8d966f8
♻️ refactor inbox `sync` core method
xavierfoucrier Nov 26, 2024
996da2c
💄 fix website link area
xavierfoucrier Nov 29, 2024
46abecf
⚡️ improve the way application restart is running
xavierfoucrier Nov 29, 2024
a72f836
⚡️ improve restart after an application update
xavierfoucrier Nov 29, 2024
5968f9d
🔒 use tls 1.3 to increase security with github
xavierfoucrier Nov 29, 2024
1c238b0
✨ properly store major/minor/patch core versions
xavierfoucrier Nov 29, 2024
d18b5d2
✏️ update visual studio version number
xavierfoucrier Nov 29, 2024
7c24444
⚡ use github api instead to get the last release
xavierfoucrier Nov 29, 2024
9642adc
📦 remove log4net package
xavierfoucrier Nov 29, 2024
a1c505e
📦 remove HtmlAgilityPack package
xavierfoucrier Nov 29, 2024
a7c5e29
✏️ rename endpoint property
xavierfoucrier Nov 30, 2024
6e682cf
⚡ only get `release` version type
xavierfoucrier Dec 2, 2024
5d157bf
🌐 add new translation for available major update
xavierfoucrier Dec 2, 2024
0a397c4
💄 focus the update button after balloon tip interaction
xavierfoucrier Dec 3, 2024
f6fa07e
✨ don't rely on tag when checking for updates
xavierfoucrier Dec 3, 2024
e1e3db5
♻️ set accessors default value
xavierfoucrier Dec 4, 2024
845c350
♻️ improve inbox sync at startup
xavierfoucrier Dec 4, 2024
1a83379
✨ manage major updates to prevent breaking changes
xavierfoucrier Dec 4, 2024
cff00e4
🐛 fix notification interaction when an update is available
xavierfoucrier Dec 4, 2024
a923c32
✏️ fix code indentation
xavierfoucrier Dec 4, 2024
7b27b7f
🔥 remove useless namespace
xavierfoucrier Dec 4, 2024
1b22674
🔖 bump version
xavierfoucrier Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/labels.yml → .github/issues/labels.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- name: a11y
description: about accessibility
color: fef2c0
- name: await test repository
description: waiting for a minimal test repository
color: 5319e7
- name: bug
description: bug to fix
color: fbca04
Expand All @@ -9,7 +15,7 @@
color: 00209a
- name: critical
description: critical failure to fix as soon as possible
color: d93f0b
color: b60205
- name: dependencies
description: update/upgrade one or more dependency
color: 0366d6
Expand All @@ -19,24 +25,30 @@
- name: documentation
description: regarding the project documentation
color: 27d19b
- name: duplicate
description: a similar issue already exists
color: ededed
- name: feature
description: feature request to implement
color: 1d76db
- name: help
description: need help, any contribution are welcome
color: 5319e7
- name: source map
description: about source mapping
color: ebe4da
- name: motion
description: motion request
description: about motion and animation
color: 32deca
- name: optimization
description: optimization request
color: 128a0c
- name: post-it
description: reminder or todo
color: fcf49c
- name: platform
- name: environment
description: regarding the environment or target platform
color: f1f1f1
- name: wontfix
description: negligible issue or that will never be fixed
color: 444444
color: 000000
43 changes: 40 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Github workflow for Continuous Integration

name: CI
name: 🤖 continuous integration

on:
push:
Expand All @@ -13,7 +13,7 @@ on:
- dev

jobs:
build:
build-debug:
runs-on: windows-latest
defaults:
run:
Expand All @@ -35,11 +35,48 @@ jobs:
run: |
msbuild.exe InboxNotifier.sln /p:configuration="Debug" /p:platform="Any CPU" /m

build-x86:
runs-on: windows-latest
needs: build-debug
defaults:
run:
working-directory: code
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Setup NuGet
uses: NuGet/setup-nuget@v2

- name: Restore NuGet packages
run: nuget restore InboxNotifier.sln

- name: Build solution — Release 32 bits (x86)
run: |
msbuild.exe InboxNotifier.sln /p:configuration="Release x86" /p:platform="Any CPU" /m

build-x64:
runs-on: windows-latest
needs: build-x86
defaults:
run:
working-directory: code
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Setup NuGet
uses: NuGet/setup-nuget@v2

- name: Restore NuGet packages
run: nuget restore InboxNotifier.sln

- name: Build solution — Release 64 bits (x64)
run: |
msbuild.exe InboxNotifier.sln /p:configuration="Release x64" /p:platform="Any CPU" /m

12 changes: 9 additions & 3 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# Github workflow to automatically sync labels in a declarative way
# https://github.com/micnncim/action-label-syncer

name: Sync labels
name: 🏷️ synchronize labels

on:
push:
branches:
- main
paths:
- '.github/labels.yml'
- .github/issues/labels.yml

permissions:
contents: write
issues: write

jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: micnncim/action-label-syncer@v1
with:
manifest: .github/issues/labels.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Note that this version of the .NET Framework **evolve in time**: the application
#### Setup installer
The setup installer contains both `32 bits (x86)` and `64 bits (x64)` versions: this is the better way to install Windows application and allow you to **cleanly install/uninstall** the application with ease.

* :package: [Inbox Notifier 3.11.0](https://github.com/xavierfoucrier/inbox-notifier/releases/download/v3.11.0/Inbox.Notifier.3.11.0.exe)
* :package: [Inbox Notifier 3.15.0](https://github.com/xavierfoucrier/inbox-notifier/releases/download/v3.15.0/Inbox.Notifier.3.15.0.exe)

> Note that you will need **administrator rights** to properly complete the installation.

Expand Down
4 changes: 0 additions & 4 deletions code/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.2.15.0" newVersion="1.2.15.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="12.0.0.0"/>
Expand Down
2 changes: 1 addition & 1 deletion code/Computer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void BindSessionSwitch() {
}

// synchronize the inbox and renew the token
await UI.GmailService.Inbox.Sync(true, true);
await UI.GmailService.Inbox.Sync(token: true);

// enable the timer properly
UI.timer.Enabled = true;
Expand Down
37 changes: 30 additions & 7 deletions code/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ static Core() {
// initialize the application version number, based on scheme Semantic Versioning - https://semver.org
string[] ProductVersion = Application.ProductVersion.Split('.');

string VersionMajor = ProductVersion[0];
string VersionMinor = ProductVersion[1];
string VersionPatch = ProductVersion[2];
MajorVersion = int.Parse(ProductVersion[0]);
MinorVersion = int.Parse(ProductVersion[1]);
PatchVersion = int.Parse(ProductVersion[2]);

Version = $"v{VersionMajor}.{VersionMinor}.{VersionPatch}";
Version = $"v{MajorVersion}.{MinorVersion}.{PatchVersion}";
}

/// <summary>
Expand All @@ -34,13 +34,15 @@ static Core() {
public static void RestartApplication() {

// start a new process
Process.Start(new ProcessStartInfo("cmd.exe", $"/C ping 127.0.0.1 -n 2 && \"{Application.ExecutablePath}\"") {
Process.Start(new ProcessStartInfo {
FileName = Application.ExecutablePath,
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true
});

// exit the application
Application.Exit();
// exit the environment
Environment.Exit(0);
}

/// <summary>
Expand Down Expand Up @@ -71,6 +73,27 @@ public static string Version {
get;
} = "";

/// <summary>
/// Major application version number
/// </summary>
public static int MajorVersion {
get;
} = 0;

/// <summary>
/// Minor application version number
/// </summary>
public static int MinorVersion {
get;
} = 0;

/// <summary>
/// Patch application version number
/// </summary>
public static int PatchVersion {
get;
} = 0;

#endregion
}
}
40 changes: 21 additions & 19 deletions code/Gmail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,13 @@ public async Task Authentication() {
// enable the main timer
UI.timer.Enabled = true;

// synchronize the user mailbox, after checking for update depending on the user settings, or by default after the asynchronous authentication
// check for update depending on the user settings
if (Settings.Default.UpdateService && Update.IsPeriodSetToStartup()) {
await UI.UpdateService.Check(!Settings.Default.UpdateDownload, true);
} else {
await Inbox.Sync();
}

// synchronize the user mailbox
await Inbox.Sync();
}

/// <summary>
Expand All @@ -139,7 +140,7 @@ public async Task<bool> RefreshToken() {

// refresh the token and update the token delivery date and time on the interface
try {
if (Credential.Token.IsExpired(Credential.Flow.Clock)) {
if (Credential.Token.IsStale) {
if (await Credential.RefreshTokenAsync(new CancellationToken())) {
UI.labelTokenDelivery.Text = Credential.Token.IssuedUtc.ToLocalTime().ToString();
}
Expand Down Expand Up @@ -188,21 +189,22 @@ private static async Task<UserCredential> AuthorizationBroker() {
using (FileStream stream = new FileStream($"{Path.GetDirectoryName(Application.ExecutablePath)}/client_secret.json", FileMode.Open, FileAccess.Read)) {

// define a cancellation token source
CancellationTokenSource cancellation = new CancellationTokenSource();
cancellation.CancelAfter(TimeSpan.FromSeconds(Settings.Default.OAUTH_TIMEOUT));

// wait for the user validation, only if the user has not already authorized the application
UserCredential credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.FromStream(stream).Secrets,
new string[] { GmailService.Scope.GmailModify },
"user",
cancellation.Token,
new FileDataStore(Core.ApplicationDataFolder, true),
new LocalServerCodeReceiver(Resources.oauth_message)
);

// return the user credential
return credential;
using (CancellationTokenSource cancellation = new CancellationTokenSource()) {
cancellation.CancelAfter(TimeSpan.FromSeconds(Settings.Default.OAUTH_TIMEOUT));

// wait for the user validation, only if the user has not already authorized the application
UserCredential credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.FromStream(stream).Secrets,
new string[] { GmailService.Scope.GmailModify },
"user",
cancellation.Token,
new FileDataStore(Core.ApplicationDataFolder, true),
new LocalServerCodeReceiver(Resources.oauth_message)
);

// return the user credential
return credential;
}
}
}

Expand Down
Loading