Skip to content

Optimize startup and background page updates - #11

Merged
AstroZer01 merged 8 commits into
mainfrom
optimize-startup-and-cached-pages
Aug 5, 2026
Merged

AstroZer01 merged 8 commits into
mainfrom
optimize-startup-and-cached-pages

Conversation

@AstroZer01

@AstroZer01 AstroZer01 commented Aug 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Restructure the published application layout while keeping the executable and account data at the application root.
  • Load WebView assets and user data from dedicated application folders, with a clear startup error if required UI files are missing.
  • Defer background update and monitoring work until the UI is ready for a smoother startup.
  • Serve Trades and Login Actions from cached background state, update pages as data changes, and guard against stale asynchronous results after actions.
  • Update the release workflow to publish the new layout and preserve formatted Markdown release notes.

Validation

  • dotnet build SteamDesktopAuthenticator.sln --no-restore -c Release

Summary by CodeRabbit

  • New Features

    • Added configurable trade-confirmation intervals from 3 seconds to 1 hour.
    • Improved dashboard updates, account filtering, tab switching, and login status details.
    • Added Windows startup support, with minimize-to-tray enabled by default.
    • Improved WebView2 data storage and application startup reliability.
  • Bug Fixes

    • Prevented outdated refresh results from replacing newer information.
    • Completed confirmations are removed only after successful actions.
    • Added clearer handling for missing web resources and navigation failures.
  • Documentation

    • Updated Windows build, publishing, and runtime instructions.
    • Refreshed the README with a project banner.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@AstroZer01, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 7556ab42-8a41-45e7-bf08-dc848c70f939

📥 Commits

Reviewing files that changed from the base of the PR and between 28154b1 and 21bc494.

📒 Files selected for processing (2)
  • Steam Desktop Authenticator/MainForm.cs
  • Steam Desktop Authenticator/Program.cs
📝 Walkthrough

Walkthrough

The release process now packages the main application with its web assets. The application uses shared WebView2 state and installation-relative paths. MainForm defers startup services and coordinates configurable, cached, revisioned trade and login data with the dashboard.

Changes

Application publishing and WebView runtime

Layer / File(s) Summary
Publish output and runtime path contract
.github/workflows/release.yml, README.md, Steam Desktop Authenticator/ApplicationPaths.cs, Steam Desktop Authenticator/Program.cs, Steam Desktop Authenticator/Steam Desktop Authenticator.csproj, Steam Desktop Authenticator/WindowsStartup.cs
The release workflow publishes the application with explicit packaging settings and validates required output paths. Application paths, startup validation, and Windows startup registration use the release folder.
Shared WebView2 startup
Steam Desktop Authenticator/WebViewEnvironmentProvider.cs, Steam Desktop Authenticator/InputForm.cs, Steam Desktop Authenticator/LoginForm.cs, Steam Desktop Authenticator/MainForm.cs
Forms use the shared WebView2 environment and installation-relative HTML paths. MainForm starts timers and background services after navigation and reports initialization or navigation failures.
Trade monitoring and settings contract
Steam Desktop Authenticator/Manifest.cs, Steam Desktop Authenticator/MainForm.cs
Trade confirmation settings replace periodic-checking fields. Monitoring uses configurable intervals, round-robin account scanning, cache reconciliation, and guarded startup.
Cached account and confirmation workflows
Steam Desktop Authenticator/MainForm.cs
MainForm caches trade confirmations and login actions, tracks unavailable and recently resolved requests, publishes revisioned data, and preserves failed or concurrent-load entries.
Dashboard tab and refresh protocol
Steam Desktop Authenticator/MainForm.cs, Steam Desktop Authenticator/wwwroot/index.html
The dashboard reports active-tab changes, separates cache loading from refresh commands, restores custom settings, and ignores stale trade and login responses by revision.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Dashboard
  participant MainForm
  participant WebViewEnvironmentProvider
  participant SteamServices
  Dashboard->>MainForm: Send tab or cache/refresh command
  MainForm->>WebViewEnvironmentProvider: GetAsync()
  WebViewEnvironmentProvider-->>MainForm: Return shared WebView2 environment
  MainForm->>SteamServices: Fetch trade or login data
  SteamServices-->>MainForm: Return account and request results
  MainForm->>Dashboard: Publish cached data with revision
  Dashboard->>Dashboard: Render accepted response
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.82% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes to startup behavior and background page updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch optimize-startup-and-cached-pages

Comment @coderabbitai help to get the list of available commands.

@AstroZer01
AstroZer01 marked this pull request as ready for review August 5, 2026 19:22
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🧹 Nitpick comments (4)
Steam Desktop Authenticator/InputForm.cs (1)

61-61: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Unhandled faults from the shared WebView2 environment in both dialog forms. Both forms call WebViewEnvironmentProvider.GetAsync() from an async void SetupModernUI with no error handling. The provider caches one task, so a single failure (missing WebView2 runtime, locked user-data folder) faults every form the same way and leaves each dialog on its loading panel.

  • Steam Desktop Authenticator/InputForm.cs#L61-L61: wrap the EnsureCoreWebView2Async call in a try/catch, log through DiagnosticErrorLogger, set lblLoading.Text to an explicit error, and return.
  • Steam Desktop Authenticator/LoginForm.cs#L78-L78: apply the same try/catch and error message around the EnsureCoreWebView2Async call.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/InputForm.cs at line 61, Handle failures from
WebViewEnvironmentProvider.GetAsync within SetupModernUI in both Steam Desktop
Authenticator/InputForm.cs at lines 61-61 and Steam Desktop
Authenticator/LoginForm.cs at lines 78-78: wrap EnsureCoreWebView2Async in
try/catch, log the exception through DiagnosticErrorLogger, set lblLoading.Text
to an explicit error message, and return so each dialog stops loading cleanly.
Steam Desktop Authenticator/MainForm.cs (3)

1212-1234: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Rename IsRecentlyResolved to reflect that it mutates the dictionary.

The name states a query, but the method removes expired entries from resolvedRequests. A future caller can use it inside an active enumeration of the same dictionary and get an InvalidOperationException. Consider PruneAndCheckRecentlyResolved, or split the pruning into a separate PruneRecentlyResolved call.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 1212 - 1234, Rename
IsRecentlyResolved to a mutation-reflecting name such as
PruneAndCheckRecentlyResolved, and update every caller accordingly. Preserve its
existing expiration cleanup and key-presence check; do not use the query-style
name for this dictionary-mutating method.

1507-1515: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low value

Remove the unused LoadLoginActionsAsync method.

The method has no callers. Its missing revision does not affect the current runtime path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 1507 - 1515, Remove the
unused LoadLoginActionsAsync method from MainForm, leaving the active
PublishCachedLoginActionsAsync path and its revision handling unchanged.

1325-1339: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Pass the confirmations array directly to loadConfirmations.

The single-quoted wrapper corrupts escaped quotes, backslashes, and newlines before JSON.parse receives the payload. StringEscapeHandling.EscapeHtml does not prevent this, and Replace("'", "\\'") is redundant.

Use the direct-object pattern from PublishCachedLoginActionsAsync, then update loadConfirmations to accept an array.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 1325 - 1339, The
confirmation payload in the `loadConfirmations` invocation is incorrectly
wrapped as a single-quoted string and manually escaped. Follow the direct-object
pattern from `PublishCachedLoginActionsAsync`: pass the serialized confirmations
array directly as the JavaScript argument, remove the `jsEscaped` and apostrophe
replacement, and update `loadConfirmations` to accept the array without
reparsing a string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 63: Update the Visual Studio alternative in the README to instruct users
to use Publish rather than Build for the Steam Desktop Authenticator project,
matching the documented runtime, output, and publish settings so the
publish/ASDA executable is created.

In `@Steam` Desktop Authenticator/ApplicationPaths.cs:
- Around line 10-12: Update the InstallDirectory property to use
Path.TrimEndingDirectorySeparator on AppContext.BaseDirectory instead of
TrimEnd, preserving the directory separator for volume-root paths such as C:\
while still removing redundant trailing separators elsewhere.

In `@Steam` Desktop Authenticator/LoginForm.cs:
- Around line 105-106: Update the login.html navigation handler in
MainForm.SetupModernUI to check args.IsSuccess after navigation, matching the
existing failure handling in MainForm.SetupModernUI, and report navigation
failures while preserving the successful loading flow.

In `@Steam` Desktop Authenticator/MainForm.cs:
- Around line 1303-1312: Guard null sessions in both WebView-driven paths: in
IsTradeCacheCompleteForSelection, filter accounts to those with non-null Session
before checking loadedTradeConfirmationAccounts; in Steam Desktop
Authenticator/MainForm.cs lines 1570-1571, update RespondToLoginActionAsync’s
account validation to reject account?.Session == null before
BuildLoginRequestKey runs.
- Around line 49-52: Update loadAccountsList() to prune all account-scoped
caches after determining the active Steam IDs and login names: remove stale
entries from loadedTradeConfirmationAccounts and loadedTradeConfirmations by
Steam ID, and from unavailableLoginAccounts by account name. Preserve entries
belonging to currently loaded accounts so cached login status and trade
confirmations remain available.
- Around line 2033-2040: Update the navigation-failure branch in MainForm’s
WebView2 initialization flow to invoke StartBackgroundServicesAfterUiReady
before returning. Preserve the existing cleanup, error message, and early return
so timerSteamGuard, loadSettings, and ConfigureLoginActionsMonitor still
initialize when UI navigation fails.
- Around line 2352-2354: Move the confirmationsSemaphore.WaitAsync acquisition
into the try/finally flow following tradeLoadSemaphore acquisition, and ensure
cleanup releases each semaphore only if that semaphore was successfully
acquired. Preserve the existing early return when tradeLoadSemaphore cannot be
acquired, and update the surrounding method to prevent an exception during
confirmation acquisition from leaving tradeLoadSemaphore held.
- Around line 1570-1571: Update the account validation in the
respond_login_action handling flow to reject accounts whose Session is null
before calling BuildLoginRequestKey. Extend the existing guard around account
and pendingLoginRequests so account.Session is validated first, while preserving
the current behavior for missing accounts and requests.
- Around line 2255-2257: Update the refresh_login_actions branch in MainForm to
call a new RefreshLoginActionsAsync helper instead of
MonitorLoginActionsSafelyAsync directly. Implement the helper to await
MonitorLoginActionsSafelyAsync first, then await PublishCachedLoginActionsAsync
unconditionally so cached data is published after early returns and regardless
of web-tab activity.

In `@Steam` Desktop Authenticator/wwwroot/index.html:
- Line 541: Update both refresh action handlers, including the
refresh_login_actions and refresh_trades postMessage call sites, to show the
existing spinner before posting the refresh request. Hide the spinner when
refreshed data arrives, and add a timeout fallback so refresh_login_actions also
stops spinning when the host returns without publishing data.

---

Nitpick comments:
In `@Steam` Desktop Authenticator/InputForm.cs:
- Line 61: Handle failures from WebViewEnvironmentProvider.GetAsync within
SetupModernUI in both Steam Desktop Authenticator/InputForm.cs at lines 61-61
and Steam Desktop Authenticator/LoginForm.cs at lines 78-78: wrap
EnsureCoreWebView2Async in try/catch, log the exception through
DiagnosticErrorLogger, set lblLoading.Text to an explicit error message, and
return so each dialog stops loading cleanly.

In `@Steam` Desktop Authenticator/MainForm.cs:
- Around line 1212-1234: Rename IsRecentlyResolved to a mutation-reflecting name
such as PruneAndCheckRecentlyResolved, and update every caller accordingly.
Preserve its existing expiration cleanup and key-presence check; do not use the
query-style name for this dictionary-mutating method.
- Around line 1507-1515: Remove the unused LoadLoginActionsAsync method from
MainForm, leaving the active PublishCachedLoginActionsAsync path and its
revision handling unchanged.
- Around line 1325-1339: The confirmation payload in the `loadConfirmations`
invocation is incorrectly wrapped as a single-quoted string and manually
escaped. Follow the direct-object pattern from `PublishCachedLoginActionsAsync`:
pass the serialized confirmations array directly as the JavaScript argument,
remove the `jsEscaped` and apostrophe replacement, and update
`loadConfirmations` to accept the array without reparsing a string.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f9292d4-3881-44d3-a03d-3438b0f771b7

📥 Commits

Reviewing files that changed from the base of the PR and between bf51c6e and 71aefb8.

⛔ Files ignored due to path filters (3)
  • github-banner.jpg is excluded by !**/*.jpg
  • screenshot main page.png is excluded by !**/*.png
  • screenshot settings.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • .github/workflows/release.yml
  • README.md
  • Steam Desktop Authenticator/ApplicationPaths.cs
  • Steam Desktop Authenticator/InputForm.cs
  • Steam Desktop Authenticator/LoginForm.cs
  • Steam Desktop Authenticator/MainForm.cs
  • Steam Desktop Authenticator/Manifest.cs
  • Steam Desktop Authenticator/Program.cs
  • Steam Desktop Authenticator/Steam Desktop Authenticator.csproj
  • Steam Desktop Authenticator/WebViewEnvironmentProvider.cs
  • Steam Desktop Authenticator/wwwroot/index.html

Comment thread README.md Outdated
Comment thread Steam Desktop Authenticator/ApplicationPaths.cs Outdated
Comment thread Steam Desktop Authenticator/LoginForm.cs
Comment thread Steam Desktop Authenticator/MainForm.cs
Comment thread Steam Desktop Authenticator/MainForm.cs
Comment thread Steam Desktop Authenticator/MainForm.cs Outdated
Comment thread Steam Desktop Authenticator/MainForm.cs
Comment thread Steam Desktop Authenticator/MainForm.cs Outdated
Comment thread Steam Desktop Authenticator/MainForm.cs Outdated
Comment thread Steam Desktop Authenticator/wwwroot/index.html

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Steam Desktop Authenticator/MainForm.cs (1)

2341-2353: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Reload when the selected account changes during an active trade load.

When a user selects account B while account A is loading, the second LoadTradesAsync returns at Line 2353. The first load does not fetch B. The page can then show stale or empty cached data for B until the user refreshes again.

Capture the selection for each load. After releasing the semaphore, queue one reload if tradeAccountSelection changed.

Proposed fix
 private async Task LoadTradesAsync(string selectedAccountName = null)
 {
     if (!String.IsNullOrWhiteSpace(selectedAccountName))
         tradeAccountSelection = selectedAccountName;
+    string selectionToLoad = tradeAccountSelection;

     ...
-    SteamGuardAccount[] accountsToLoad = tradeAccountSelection == "all"
+    SteamGuardAccount[] accountsToLoad = selectionToLoad == "all"
         ? allAccounts
-        : allAccounts.Where(account => account.AccountName == tradeAccountSelection).ToArray();
+        : allAccounts.Where(account => account.AccountName == selectionToLoad).ToArray();

     ...
     finally
     {
         confirmationsSemaphore.Release();
         tradeLoadSemaphore.Release();
+        if (!String.Equals(selectionToLoad, tradeAccountSelection, StringComparison.Ordinal))
+            _ = LoadTradesAsync();
     }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 2341 - 2353, Update
LoadTradesAsync to capture the account selection at the start of each load and,
when semaphore acquisition fails because another load is active, record that a
reload is needed if tradeAccountSelection differs. After the active load
releases tradeLoadSemaphore, compare the captured selection with the current
selection and queue exactly one LoadTradesAsync reload when it changed, ensuring
the latest account is fetched without creating repeated reloads.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Steam` Desktop Authenticator/InputForm.cs:
- Line 105: Update the input.html navigation completion handler near the
htmlPath setup to check args.IsSuccess before swapping controls. On failure,
keep loadingPanel visible, display the load error, and return without hiding
fallback controls or showing webView; only perform the existing successful
navigation control changes when navigation succeeds.

---

Outside diff comments:
In `@Steam` Desktop Authenticator/MainForm.cs:
- Around line 2341-2353: Update LoadTradesAsync to capture the account selection
at the start of each load and, when semaphore acquisition fails because another
load is active, record that a reload is needed if tradeAccountSelection differs.
After the active load releases tradeLoadSemaphore, compare the captured
selection with the current selection and queue exactly one LoadTradesAsync
reload when it changed, ensuring the latest account is fetched without creating
repeated reloads.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 08d4b29b-42f3-4d51-a1d6-f97fde0bec23

📥 Commits

Reviewing files that changed from the base of the PR and between bf51c6e and 71aefb8.

⛔ Files ignored due to path filters (3)
  • github-banner.jpg is excluded by !**/*.jpg
  • screenshot main page.png is excluded by !**/*.png
  • screenshot settings.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • .github/workflows/release.yml
  • README.md
  • Steam Desktop Authenticator/ApplicationPaths.cs
  • Steam Desktop Authenticator/InputForm.cs
  • Steam Desktop Authenticator/LoginForm.cs
  • Steam Desktop Authenticator/MainForm.cs
  • Steam Desktop Authenticator/Manifest.cs
  • Steam Desktop Authenticator/Program.cs
  • Steam Desktop Authenticator/Steam Desktop Authenticator.csproj
  • Steam Desktop Authenticator/WebViewEnvironmentProvider.cs
  • Steam Desktop Authenticator/wwwroot/index.html

Comment thread Steam Desktop Authenticator/InputForm.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Steam Desktop Authenticator/MainForm.cs (1)

2323-2335: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not drop a newer trade selection while a load is active.

LoadTradesAsync changes tradeAccountSelection before it attempts tradeLoadSemaphore. If a load for account A is awaiting Steam and the user refreshes account B, the second call returns at Line 2335. The first call can finish with account A data, publish using the now-global account B selection, and never fetch B.

Capture the requested selection in a local variable. Use that variable to build accountsToLoad. After releasing the semaphore, schedule one reload when tradeAccountSelection changed during the load.

Proposed fix
 private async Task LoadTradesAsync(string selectedAccountName = null)
 {
+    string requestedSelection = !String.IsNullOrWhiteSpace(selectedAccountName)
+        ? selectedAccountName
+        : tradeAccountSelection;
+
     if (!String.IsNullOrWhiteSpace(selectedAccountName))
         tradeAccountSelection = selectedAccountName;
 ...
-    SteamGuardAccount[] accountsToLoad = tradeAccountSelection == "all"
+    SteamGuardAccount[] accountsToLoad = requestedSelection == "all"
         ? allAccounts
-        : allAccounts.Where(account => account.AccountName == tradeAccountSelection).ToArray();
+        : allAccounts.Where(account => account.AccountName == requestedSelection).ToArray();
 ...
     finally
     {
         confirmationsSemaphore.Release();
         tradeLoadSemaphore.Release();
+        if (!String.Equals(requestedSelection, tradeAccountSelection, StringComparison.Ordinal))
+            _ = LoadTradesAsync(tradeAccountSelection);
     }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 2323 - 2335, Update
LoadTradesAsync to capture the requested account selection locally before
changing shared state, and use that local value when constructing
accountsToLoad. If semaphore acquisition fails because another load is active,
ensure the completed load schedules one follow-up reload whenever
tradeAccountSelection changed during it, so a newer selection is not dropped.
♻️ Duplicate comments (1)
Steam Desktop Authenticator/MainForm.cs (1)

2237-2239: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make explicit login refresh work when monitoring is disabled.

When LoginActionMonitoringEnabled is false, MonitorLoginActionsAsync returns at Lines 978-979. The refresh_login_actions action then does not fetch current requests. It also does not publish cached state when rate limiting or loginActionsSemaphore causes an early return.

Add a refresh path that performs fetch-only reconciliation in manual mode, updates pendingLoginRequests and unavailableLoginAccounts, and always calls PublishCachedLoginActionsAsync after the attempt. Do not run automatic decisions from that fetch-only path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 2237 - 2239, Update the
refresh_login_actions branch in MainForm to use a manual fetch-only
reconciliation path when LoginActionMonitoringEnabled is false, rather than
relying on MonitorLoginActionsAsync. Ensure this path updates
pendingLoginRequests and unavailableLoginAccounts, skips automatic decisions,
and always invokes PublishCachedLoginActionsAsync after the attempt, including
rate-limit or loginActionsSemaphore early returns; preserve normal monitoring
behavior when enabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Steam` Desktop Authenticator/Manifest.cs:
- Around line 36-40: Update GetManifest() to read legacy periodic_checking and
periodic_checking_interval values before applying defaults, mapping them to
TradeConfirmationCustomIntervalEnabled and TradeConfirmationCheckInterval.
Explicitly handle periodic_checking_checkall as the new monitor always scans all
accounts, then normalize the migrated values so startup Save() preserves them
instead of writing defaults.

---

Outside diff comments:
In `@Steam` Desktop Authenticator/MainForm.cs:
- Around line 2323-2335: Update LoadTradesAsync to capture the requested account
selection locally before changing shared state, and use that local value when
constructing accountsToLoad. If semaphore acquisition fails because another load
is active, ensure the completed load schedules one follow-up reload whenever
tradeAccountSelection changed during it, so a newer selection is not dropped.

---

Duplicate comments:
In `@Steam` Desktop Authenticator/MainForm.cs:
- Around line 2237-2239: Update the refresh_login_actions branch in MainForm to
use a manual fetch-only reconciliation path when LoginActionMonitoringEnabled is
false, rather than relying on MonitorLoginActionsAsync. Ensure this path updates
pendingLoginRequests and unavailableLoginAccounts, skips automatic decisions,
and always invokes PublishCachedLoginActionsAsync after the attempt, including
rate-limit or loginActionsSemaphore early returns; preserve normal monitoring
behavior when enabled.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e469daac-723b-4a66-bd0e-5477043149a3

📥 Commits

Reviewing files that changed from the base of the PR and between 71aefb8 and 396e6cd.

📒 Files selected for processing (5)
  • Steam Desktop Authenticator/MainForm.cs
  • Steam Desktop Authenticator/Manifest.cs
  • Steam Desktop Authenticator/Program.cs
  • Steam Desktop Authenticator/WindowsStartup.cs
  • Steam Desktop Authenticator/wwwroot/index.html

Comment thread Steam Desktop Authenticator/Manifest.cs
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Line 100: Update the release workflow’s run steps that use
github.event.inputs.release_type or github.event.inputs.version, including the
Compress-Archive command, to reference environment variables via
$env:RELEASE_TYPE and $env:VERSION instead. Define those environment variables
from the workflow inputs at the appropriate job or step scope, and remove direct
interpolation of the free-form version input from PowerShell source.

In `@Steam` Desktop Authenticator/MainForm.cs:
- Line 2039: Update the MainForm initialization flow around
EnsureCoreWebView2Async to catch initialization failures and follow the existing
local recovery behavior used by InputForm and LoginForm. Ensure the loading UI
is dismissed and StartBackgroundServicesAfterUiReady still runs or the failure
is otherwise handled consistently, without allowing the async void method to
exit before navigation handlers and background services are initialized.

In `@Steam` Desktop Authenticator/wwwroot/index.html:
- Line 573: Update the trade-cache loading flow around the `postMessage` call
and `loadConfirmations` so each request carries the selected account or a unique
request token, and ensure `loadConfirmations` rejects results that no longer
match the current selection before updating the UI.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d3a6d40-8a2d-49fe-9543-0fcb78d5a19a

📥 Commits

Reviewing files that changed from the base of the PR and between bf51c6e and 2bfffde.

⛔ Files ignored due to path filters (3)
  • github-banner.jpg is excluded by !**/*.jpg
  • screenshot main page.png is excluded by !**/*.png
  • screenshot settings.png is excluded by !**/*.png
📒 Files selected for processing (12)
  • .github/workflows/release.yml
  • README.md
  • Steam Desktop Authenticator/ApplicationPaths.cs
  • Steam Desktop Authenticator/InputForm.cs
  • Steam Desktop Authenticator/LoginForm.cs
  • Steam Desktop Authenticator/MainForm.cs
  • Steam Desktop Authenticator/Manifest.cs
  • Steam Desktop Authenticator/Program.cs
  • Steam Desktop Authenticator/Steam Desktop Authenticator.csproj
  • Steam Desktop Authenticator/WebViewEnvironmentProvider.cs
  • Steam Desktop Authenticator/WindowsStartup.cs
  • Steam Desktop Authenticator/wwwroot/index.html

Comment thread .github/workflows/release.yml Outdated
Comment thread Steam Desktop Authenticator/MainForm.cs Outdated
Comment thread Steam Desktop Authenticator/wwwroot/index.html

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
Steam Desktop Authenticator/MainForm.cs (3)

125-137: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Cap the monitor retry delay independently of the poll interval.

FetchTradeConfirmationsForMonitorAsync passes the poll interval as retryDelay with retryCount = 3. The interval is user-configurable up to 3600 seconds. A failing account then keeps confirmationsSemaphore held for up to three interval delays. During that time timerTradesPopup_Tick returns immediately at Line 859, and LoadTradesAsync blocks on await confirmationsSemaphore.WaitAsync() at Line 2361, so the trades page stops refreshing for a long period.

Use a separate bounded backoff for retries.

🐛 Proposed fix
         private Task<Confirmation[]> FetchTradeConfirmationsForMonitorAsync(SteamGuardAccount account)
         {
-            int seconds = GetTradeConfirmationMonitorIntervalSeconds();
-            return FetchTradeConfirmationsAsync(account, TimeSpan.FromSeconds(seconds), 3);
+            int seconds = Math.Min(GetTradeConfirmationMonitorIntervalSeconds(), 15);
+            return FetchTradeConfirmationsAsync(account, TimeSpan.FromSeconds(seconds), 3);
         }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 125 - 137, Update
FetchTradeConfirmationsForMonitorAsync so the retryDelay is independent of
GetTradeConfirmationMonitorIntervalSeconds and uses a short bounded backoff,
while preserving the existing retryCount of 3 and the user-configured interval
for polling. Keep GetTradeConfirmationMonitorIntervalSeconds responsible only
for the monitor poll interval.

907-918: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the cached confirmation set between the monitor and the page loader.

The monitor caches only pendingConfirmations at Line 916, so auto-confirm-eligible entries are excluded. LoadTradesAsync caches every fetched confirmation at Line 2384. A manual refresh therefore lists market or trade confirmations that the monitor auto-accepts. The user can click accept on an entry that Steam already resolved, and the entry disappears on the next monitor tick.

Filter the auto-confirm types in LoadTradesAsync, or cache all confirmations in the monitor, so both paths publish the same set.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 907 - 918, The trade
confirmation cache is populated inconsistently between the monitor and
LoadTradesAsync, allowing auto-confirmed entries to remain visible after
resolution. Update the monitor flow around CacheTradeConfirmations to cache the
same confirmation set as LoadTradesAsync, or apply the identical auto-confirm
filtering in LoadTradesAsync, so both paths publish matching user-visible
entries.

2028-2040: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Retry monitoring setup after manifest initialization

If EnsureCoreWebView2Async fails before MainForm_Shown, the latch is set while manifest is null. Both monitoring setup methods then return, and MainForm_Shown does not retry them. Trade and login monitoring remain disabled for the session. Start these services after manifest initialization or retry them from MainForm_Shown.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 2028 - 2040, Update the
WebView2 initialization failure path around EnsureCoreWebView2Async so
monitoring setup is deferred until manifest initialization completes. Ensure
StartBackgroundServicesAfterUiReady or MainForm_Shown retries both trade and
login monitoring after manifest is available, rather than leaving them disabled
for the session.
🧹 Nitpick comments (1)
Steam Desktop Authenticator/MainForm.cs (1)

1624-1625: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use RefreshLoginActionsAsync after a manual login action.

MonitorLoginActionsSafelyAsync returns at Line 978 when manifest.LoginActionMonitoringEnabled is false. With monitoring disabled, the list is never re-fetched after a manual approve or deny, so requests that Steam resolved elsewhere stay in pendingLoginRequests until the user presses refresh. RefreshLoginActionsAsync selects the manual fetch in that case.

♻️ Proposed change
             await PublishCachedLoginActionsAsync();
-            _ = MonitorLoginActionsSafelyAsync();
+            _ = RefreshLoginActionsAsync();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Steam` Desktop Authenticator/MainForm.cs around lines 1624 - 1625, After
PublishCachedLoginActionsAsync in the manual login action flow, invoke
RefreshLoginActionsAsync instead of relying only on
MonitorLoginActionsSafelyAsync, so pendingLoginRequests is re-fetched even when
manifest.LoginActionMonitoringEnabled is disabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@Steam` Desktop Authenticator/MainForm.cs:
- Around line 125-137: Update FetchTradeConfirmationsForMonitorAsync so the
retryDelay is independent of GetTradeConfirmationMonitorIntervalSeconds and uses
a short bounded backoff, while preserving the existing retryCount of 3 and the
user-configured interval for polling. Keep
GetTradeConfirmationMonitorIntervalSeconds responsible only for the monitor poll
interval.
- Around line 907-918: The trade confirmation cache is populated inconsistently
between the monitor and LoadTradesAsync, allowing auto-confirmed entries to
remain visible after resolution. Update the monitor flow around
CacheTradeConfirmations to cache the same confirmation set as LoadTradesAsync,
or apply the identical auto-confirm filtering in LoadTradesAsync, so both paths
publish matching user-visible entries.
- Around line 2028-2040: Update the WebView2 initialization failure path around
EnsureCoreWebView2Async so monitoring setup is deferred until manifest
initialization completes. Ensure StartBackgroundServicesAfterUiReady or
MainForm_Shown retries both trade and login monitoring after manifest is
available, rather than leaving them disabled for the session.

---

Nitpick comments:
In `@Steam` Desktop Authenticator/MainForm.cs:
- Around line 1624-1625: After PublishCachedLoginActionsAsync in the manual
login action flow, invoke RefreshLoginActionsAsync instead of relying only on
MonitorLoginActionsSafelyAsync, so pendingLoginRequests is re-fetched even when
manifest.LoginActionMonitoringEnabled is disabled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 9813aabf-d021-4746-8941-8211dc409c43

📥 Commits

Reviewing files that changed from the base of the PR and between d9c4724 and 4ab4200.

📒 Files selected for processing (1)
  • Steam Desktop Authenticator/MainForm.cs

@AstroZer01

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@AstroZer01
AstroZer01 merged commit 22d1479 into main Aug 5, 2026
6 of 7 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant