Skip to content

fix: resend steam presence after reconnect#1278

Merged
utkarshdalal merged 3 commits into
utkarshdalal:masterfrom
xXJSONDeruloXx:fix/steam-playtime-resume
May 17, 2026
Merged

fix: resend steam presence after reconnect#1278
utkarshdalal merged 3 commits into
utkarshdalal:masterfrom
xXJSONDeruloXx:fix/steam-playtime-resume

Conversation

@xXJSONDeruloXx
Copy link
Copy Markdown
Contributor

@xXJSONDeruloXx xXJSONDeruloXx commented Apr 23, 2026

Description

Simple fix where if steam connection is lost while game is running, the playtime would be dropped. this lets long running sessions keep properly reporting play time when steam connection is dropped and regained.

Recording

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Resends Steam presence after reconnect so playtime and resume state recover correctly. Tracks a single active game session and re-notifies Steam after connection drops.

  • Bug Fixes
    • Added ActiveGameRegistry single-slot store to keep the current GameProcessInfo across reconnects and avoid stale re-announces.
    • On Steam reconnect, SteamService restores persona state and re-sends notifyRunningProcesses for the active game.
    • MainViewModel records/clears the session on launch/exit; skips and clears when real Steam handles presence; app teardown clears the registry.
    • More detailed persona-state logs (state, appId, name) for easier debugging.

Written for commit 53f0bb2. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features

    • Added an active-game session registry to track running game processes.
  • Improvements

    • Improved tracking of active game sessions during runtime.
    • Steam reconnection now restores and re-notifies about active sessions.
    • Better coordination between app lifecycle events and Steam notifications.
  • Bug Fixes / Stability

    • Shutdown now clears tracked sessions to ensure thorough resource cleanup.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

Adds a single-entry, thread-safe ActiveGameRegistry and integrates it into shutdown (PluviaApp), MainViewModel lifecycle events (window mapped / app exit), and SteamService reconnect/persona logging to re-notify running processes when appropriate.

Changes

Active game lifecycle coordination

Layer / File(s) Summary
Registry implementation
app/src/main/java/app/gamenative/service/ActiveGameRegistry.kt
New ActiveGameRegistry singleton storing one GameProcessInfo in a @Volatile field with synchronized get, set, clearIfMatches(appId), and clear methods.
ViewModel lifecycle wiring
app/src/main/java/app/gamenative/ui/model/MainViewModel.kt
Imports ActiveGameRegistry; clears matching registry entry on Steam-launched app exit; on window mapping, sets the registry and calls SteamService.notifyRunningProcesses when shouldLaunchRealSteam is false, otherwise clears the registry.
SteamService reconnection & persona logging
app/src/main/java/app/gamenative/service/SteamService.kt
On Steam logon, checks ActiveGameRegistry and asynchronously re-sends running-process notifications if an active entry exists; replaces a minimal persona-state log with a detailed debug message including gamePlayedAppId and gameName.
Shutdown integration
app/src/main/java/app/gamenative/PluviaApp.kt
shutdownEnvironment() now calls ActiveGameRegistry.clear() during teardown.

Sequence Diagram(s)

sequenceDiagram
  participant MainVM as MainViewModel
  participant Registry as ActiveGameRegistry
  participant Steam as SteamService
  participant Backend as Steam Backend
  participant App as PluviaApp

  MainVM->>Registry: set(GameProcessInfo) / clearIfMatches(appId)
  MainVM->>Steam: notifyRunningProcesses(GameProcessInfo) [when shouldLaunchRealSteam = false]

  App->>Registry: clear()  %% shutdown calls clear()

  note over Steam,Registry: on Steam logon
  Steam->>Registry: get()
  alt registry has entry
    Steam->>Backend: notifyRunningProcesses(active entry)
  else no entry
    Steam-->>Steam: debug log (no active games)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • utkarshdalal/GameNative#1136: Previously modified PluviaApp.shutdownEnvironment(); directly related to adding registry clear in teardown.
  • utkarshdalal/GameNative#1306: Also adjusts Steam/session teardown flows (different cleanup calls), related to reconnection/teardown behavior.

Suggested reviewers

  • utkarshdalal
  • phobos665

Poem

🐇
I keep one game upon my shelf,
A tidy hop, I mind myself.
On map or logon, I softly tell,
When shutdown comes I clear the well.
Hooray for neat and tidy play!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% 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
Title check ✅ Passed The title 'fix: resend steam presence after reconnect' accurately captures the main change—adding logic to re-send Steam presence notifications after reconnection to preserve playtime tracking.
Description check ✅ Passed The description includes the required sections (Description, Type of Change, and Checklist) with substantive explanations of the bug fix, confirms alignment with project scope, and includes an auto-generated summary detailing the changes.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@xXJSONDeruloXx xXJSONDeruloXx marked this pull request as ready for review April 23, 2026 13:53
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/java/app/gamenative/service/SteamService.kt`:
- Around line 3475-3480: The code captures ActiveGameRegistry.all() before
launching a coroutine, risking replaying a stale snapshot; update the coroutine
to re-read the registry immediately inside the launched block (call
ActiveGameRegistry.all() just before notifyRunningProcesses) or otherwise
serialize presence updates so exitSteamApp wins; specifically change the
scope.launch block that currently uses the outer activeGames variable to fetch a
fresh list and pass that to notifyRunningProcesses (or implement a
serialized/locked update path around notifyRunningProcesses/exitSteamApp to
ensure the latest lifecycle state is used).

In `@app/src/main/java/app/gamenative/ui/model/MainViewModel.kt`:
- Around line 490-493: Guard the registry removal so it only runs for Steam
containers: before calling ContainerUtils.extractGameIdFromContainerId(appId) /
ActiveGameRegistry.remove(gameId) check that the appId represents a Steam
container (e.g., add a ContainerUtils.isSteamContainer(appId) or equivalent
check), only extract the numeric gameId and call
ActiveGameRegistry.remove(gameId) when that Steam-check passes, and always call
SteamService.notifyRunningProcesses() after (or when appropriate) to keep
process state in sync.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4886213f-b561-4df1-a9ae-18d484b49be0

📥 Commits

Reviewing files that changed from the base of the PR and between 7cc1ac0 and 3cac856.

📒 Files selected for processing (4)
  • app/src/main/java/app/gamenative/PluviaApp.kt
  • app/src/main/java/app/gamenative/service/ActiveGameRegistry.kt
  • app/src/main/java/app/gamenative/service/SteamService.kt
  • app/src/main/java/app/gamenative/ui/model/MainViewModel.kt

Comment on lines +3475 to +3480
val activeGames = ActiveGameRegistry.all()
if (activeGames.isNotEmpty()) {
Timber.i("Re-sending %d active game session(s) after Steam reconnect", activeGames.size)
scope.launch {
notifyRunningProcesses(*activeGames.toTypedArray())
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid replaying a stale active-game snapshot.

activeGames is captured before the coroutine runs. If the game exits right after Line 3475, exitSteamApp() can remove it and send an empty notifyRunningProcesses(), but this queued coroutine may later send the old GameProcessInfo and resurrect Steam presence/playtime for a closed game.

Re-read the registry inside the launched work immediately before notifying, or serialize reconnect/exit presence updates so the latest lifecycle state wins.

🐛 Minimal stale-snapshot reduction
-                val activeGames = ActiveGameRegistry.all()
-                if (activeGames.isNotEmpty()) {
-                    Timber.i("Re-sending %d active game session(s) after Steam reconnect", activeGames.size)
-                    scope.launch {
-                        notifyRunningProcesses(*activeGames.toTypedArray())
-                    }
-                } else {
-                    Timber.d("No active game sessions to re-send after Steam reconnect")
-                }
+                scope.launch {
+                    val activeGames = ActiveGameRegistry.all()
+                    if (activeGames.isNotEmpty()) {
+                        Timber.i("Re-sending %d active game session(s) after Steam reconnect", activeGames.size)
+                        notifyRunningProcesses(*activeGames.toTypedArray())
+                    } else {
+                        Timber.d("No active game sessions to re-send after Steam reconnect")
+                    }
+                }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/app/gamenative/service/SteamService.kt` around lines 3475 -
3480, The code captures ActiveGameRegistry.all() before launching a coroutine,
risking replaying a stale snapshot; update the coroutine to re-read the registry
immediately inside the launched block (call ActiveGameRegistry.all() just before
notifyRunningProcesses) or otherwise serialize presence updates so exitSteamApp
wins; specifically change the scope.launch block that currently uses the outer
activeGames variable to fetch a fresh list and pass that to
notifyRunningProcesses (or implement a serialized/locked update path around
notifyRunningProcesses/exitSteamApp to ensure the latest lifecycle state is
used).

Comment on lines 490 to 493
val gameId = ContainerUtils.extractGameIdFromContainerId(appId)
Timber.tag("Exit").i("Got game id: $gameId")
ActiveGameRegistry.remove(gameId)
SteamService.notifyRunningProcesses()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Guard registry removal to Steam apps.

exitSteamApp() handles non-Steam sources too, but ActiveGameRegistry is Steam-specific and keyed only by numeric gameId. A GOG/Epic/custom game with the same numeric ID could remove an unrelated Steam presence entry.

🛡️ Proposed guard
                 val gameId = ContainerUtils.extractGameIdFromContainerId(appId)
                 Timber.tag("Exit").i("Got game id: $gameId")
-                ActiveGameRegistry.remove(gameId)
-                SteamService.notifyRunningProcesses()
+                if (ContainerUtils.extractGameSourceFromContainerId(appId) == GameSource.STEAM) {
+                    ActiveGameRegistry.remove(gameId)
+                    SteamService.notifyRunningProcesses()
+                }
                 handleExitCloudSync(context, appId, gameId)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val gameId = ContainerUtils.extractGameIdFromContainerId(appId)
Timber.tag("Exit").i("Got game id: $gameId")
ActiveGameRegistry.remove(gameId)
SteamService.notifyRunningProcesses()
val gameId = ContainerUtils.extractGameIdFromContainerId(appId)
Timber.tag("Exit").i("Got game id: $gameId")
if (ContainerUtils.extractGameSourceFromContainerId(appId) == GameSource.STEAM) {
ActiveGameRegistry.remove(gameId)
SteamService.notifyRunningProcesses()
}
handleExitCloudSync(context, appId, gameId)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/app/gamenative/ui/model/MainViewModel.kt` around lines 490
- 493, Guard the registry removal so it only runs for Steam containers: before
calling ContainerUtils.extractGameIdFromContainerId(appId) /
ActiveGameRegistry.remove(gameId) check that the appId represents a Steam
container (e.g., add a ContainerUtils.isSteamContainer(appId) or equivalent
check), only extract the numeric gameId and call
ActiveGameRegistry.remove(gameId) when that Steam-check passes, and always call
SteamService.notifyRunningProcesses() after (or when appropriate) to keep
process state in sync.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@phobos665
Copy link
Copy Markdown
Contributor

So just to understand the original issue:

  1. User is online playing a game
  2. User temporarily loses a connection
  3. Playtime no longer is reported for the rest of this session?

Now what happens with this PR:

  1. The process goes into a hashmap
  2. On reconnect, we re-trigger the services
  3. Process name is consumed and is continued to be tracked

Does that sum it up accurately?

@utkarshdalal
Copy link
Copy Markdown
Owner

This is for tracking playtime? Have you tested it? Because it's not really making sense to me.
Playtime tracking is started by SteamService.notifyRunningProcesses(it) on launch, and then stopped by SteamService.notifyRunningProcesses() on exit. This is not a signal that is continuously sent and I am not seeing how a registry would help?
If you have tested and seen a difference or this is for another case, let me know.

@xXJSONDeruloXx
Copy link
Copy Markdown
Contributor Author

@utkarshdalal this is for cases where you sleep fo long periods of time like 30 min or more, often with a network disconnect in between, and playtime count is dropped in the middle. In my tests with this after 30 minutes an network loss and regain it was able to keep playtime

@utkarshdalal
Copy link
Copy Markdown
Owner

utkarshdalal commented Apr 27, 2026

But playtime doesn't stop being tracked unless SteamService.notifyRunningProcesses() is called inside exitSteamApp. If this is really happening, then the fix is to handle it so that exitSteamApp is not called on game pause. This approach is just going to lead to duplicate calls to SteamService.notifyRunningProcesses(it) and I have no idea how that will behave on the steam side.

@xXJSONDeruloXx
Copy link
Copy Markdown
Contributor Author

@utkarshdalal
please see the attached logs, I started a game, went to airplane mode, then restored connection. I dont think exitSteamApp on pause is the culprit but please sanity check me:

  1. exitSteamApp was never called during the network disconnect so the issue isn't a premature exit being triggered afaik
  2. On reconnect, Steam came back on a completely different server (cmp1-atl3 to cmp2-dfw2) with no memory of the game session which I think means the presence state is dropped server-side
  3. registry re-sent notifyRunningProcesses for the active game within ~16 seconds of reconnect

logs from the test run:

logs.txt

@utkarshdalal
Copy link
Copy Markdown
Owner

And you saw that your playtime isn't being added when your connection drops but it is after your change? Are you sure about this? Both the problem and solution are not adding up for me.

@xXJSONDeruloXx
Copy link
Copy Markdown
Contributor Author

Yeah, so say you start a game and play for 10 minutes then get disconnected from steam. Server commits that 10 minutes and adds it to your total.

Then you reconnect later and you're on a new CM server, current code you'd not get any more playtime but with this PR you're now getting a new re-notify and new server starts a count again. The only thing you will lose is the gap while disconnected which was being lost regardless (and in cases of sleeping the device, is good and expected). Benefit is that now you will get subsequent playtime counts on reconnect.

@xXJSONDeruloXx
Copy link
Copy Markdown
Contributor Author

See this thread for issues with current behavior

https://discord.com/channels/1378308569287622737/1489393232935915571

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
app/src/main/java/app/gamenative/service/SteamService.kt (1)

3453-3458: ⚠️ Potential issue | 🟠 Major

Re-read active sessions inside the coroutine to avoid replaying stale presence.

At Line 3453, activeGames is snapshotted before scope.launch. If a game exits before the coroutine runs, this can re-send a stale GameProcessInfo and briefly resurrect presence/playtime for a closed game.

🐛 Minimal fix
-                val activeGames = ActiveGameRegistry.all()
-                if (activeGames.isNotEmpty()) {
-                    Timber.i("Re-sending %d active game session(s) after Steam reconnect", activeGames.size)
-                    scope.launch {
-                        notifyRunningProcesses(*activeGames.toTypedArray())
-                    }
-                } else {
-                    Timber.d("No active game sessions to re-send after Steam reconnect")
-                }
+                scope.launch {
+                    val activeGames = ActiveGameRegistry.all()
+                    if (activeGames.isNotEmpty()) {
+                        Timber.i("Re-sending %d active game session(s) after Steam reconnect", activeGames.size)
+                        notifyRunningProcesses(*activeGames.toTypedArray())
+                    } else {
+                        Timber.d("No active game sessions to re-send after Steam reconnect")
+                    }
+                }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/app/gamenative/service/SteamService.kt` around lines 3453 -
3458, activeGames is captured before launching the coroutine, causing stale
GameProcessInfo to be re-sent if sessions end before the coroutine runs; fix by
moving the snapshot inside the coroutine: inside the scope.launch block call
ActiveGameRegistry.all() again (and check isNotEmpty there) and pass its result
into notifyRunningProcesses, referencing the existing ActiveGameRegistry.all(),
scope.launch, notifyRunningProcesses(...) and the activeGames usage so you
re-read the live registry at send-time instead of using the pre-captured list.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@app/src/main/java/app/gamenative/service/SteamService.kt`:
- Around line 3453-3458: activeGames is captured before launching the coroutine,
causing stale GameProcessInfo to be re-sent if sessions end before the coroutine
runs; fix by moving the snapshot inside the coroutine: inside the scope.launch
block call ActiveGameRegistry.all() again (and check isNotEmpty there) and pass
its result into notifyRunningProcesses, referencing the existing
ActiveGameRegistry.all(), scope.launch, notifyRunningProcesses(...) and the
activeGames usage so you re-read the live registry at send-time instead of using
the pre-captured list.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e6292d4e-8cd3-4894-8c1b-a91ed06af4ef

📥 Commits

Reviewing files that changed from the base of the PR and between 3cac856 and a16975a.

📒 Files selected for processing (1)
  • app/src/main/java/app/gamenative/service/SteamService.kt

@phobos665
Copy link
Copy Markdown
Contributor

Yeah, so say you start a game and play for 10 minutes then get disconnected from steam. Server commits that 10 minutes and adds it to your total.

Then you reconnect later and you're on a new CM server, current code you'd not get any more playtime but with this PR you're now getting a new re-notify and new server starts a count again. The only thing you will lose is the gap while disconnected which was being lost regardless (and in cases of sleeping the device, is good and expected). Benefit is that now you will get subsequent playtime counts on reconnect.

@utkarshdalal I think this is worth us discussing as a group a bit more. Seen quite a few people get tripped up by this behavoiur it seems.

@utkarshdalal
Copy link
Copy Markdown
Owner

@phobos665 - sounds good, i'm checking with the people in the thread. For at least two of them, the games they're playing aren't detected as running at all, has nothing to do with this change of it not detecting when device is put to sleep. The fix there was to check the process name and not the name of the exe, I had a PR for that but it's quite brittle.

@utkarshdalal
Copy link
Copy Markdown
Owner

utkarshdalal commented May 17, 2026

@xXJSONDeruloXx - looks like your assessment was right here. Happy to merge but we need to store a single active game and not a list as this could cause weird bugs. Here's an explanation AI wrote for me:

Suggest replacing ActiveGameRegistry's ConcurrentHashMap<Int, GameProcessInfo> with a single nullable slot (@volatile var active: GameProcessInfo? = null).

GameNative only ever runs one game at a time, so the map can only accumulate >1 entry in pathological cases — put happening without a matching remove (game crash, force-close, exit event not firing). When that happens, the map becomes a footgun:

Ghost re-announcement on reconnect. onLoggedOn resends every entry via notifyRunningProcesses(*all().toTypedArray()). A stale entry would be announced as running, and Steam would start crediting playtime to a game that isn't actually running.
No cleanup signal follows. The exit path does remove(gameId) then notifyRunningProcesses() with no args (empty list → "nothing running"). At the moment of exit, Steam's view is correct, but the ghost stays in the registry. The next reconnect re-announces it, and no "stopped" message ever follows — it only gets flushed by another full game exit or by app teardown's clear().
A single slot makes "at most one game, and it matches reality" structurally true instead of an invariant we have to maintain by convention across every put/remove site. The launch site sets it, the exit site nulls it, the reconnect resend is active?.let { notifyRunningProcesses(it) }, and the whole class of "two games in the map" bugs disappears.

TL;DR - if there's ever more than one game in the registry, the second game will keep adding playtime every onLoggedOn indefinitely

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/main/java/app/gamenative/service/ActiveGameRegistry.kt (1)

17-20: ⚡ Quick win

Consider adding a defensive check or warning log when overwriting an active game.

While the single-slot design correctly reflects GameNative's one-game-at-a-time constraint, silently overwriting an existing entry could mask lifecycle bugs (e.g., set() called twice without an intervening clear()). A warning log would aid debugging without adding significant complexity.

🛡️ Proposed defensive logging
 `@Synchronized`
 fun set(gameProcessInfo: GameProcessInfo) {
+    if (activeGame != null) {
+        // Log warning: overwriting an existing active game entry
+        println("WARNING: ActiveGameRegistry.set() called while activeGame is already set (appId=${activeGame?.appId}). This may indicate a lifecycle bug.")
+    }
     activeGame = gameProcessInfo
 }
🤖 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 `@app/src/main/java/app/gamenative/service/ActiveGameRegistry.kt` around lines
17 - 20, The set(gameProcessInfo: GameProcessInfo) method in ActiveGameRegistry
currently overwrites activeGame silently; change it to check the existing
activeGame (the field activeGame) inside the `@Synchronized` set and, if non-null,
emit a warning-level log that includes identifying details of the current
activeGame and the incoming gameProcessInfo (so you can trace unexpected
double-sets), then proceed to replace the value; use the class logger (or add
one if missing) and keep synchronization and behavior unchanged other than the
warning.
🤖 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.

Nitpick comments:
In `@app/src/main/java/app/gamenative/service/ActiveGameRegistry.kt`:
- Around line 17-20: The set(gameProcessInfo: GameProcessInfo) method in
ActiveGameRegistry currently overwrites activeGame silently; change it to check
the existing activeGame (the field activeGame) inside the `@Synchronized` set and,
if non-null, emit a warning-level log that includes identifying details of the
current activeGame and the incoming gameProcessInfo (so you can trace unexpected
double-sets), then proceed to replace the value; use the class logger (or add
one if missing) and keep synchronization and behavior unchanged other than the
warning.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 76785523-3f99-461c-b326-6f2719184011

📥 Commits

Reviewing files that changed from the base of the PR and between a16975a and 53f0bb2.

📒 Files selected for processing (3)
  • app/src/main/java/app/gamenative/service/ActiveGameRegistry.kt
  • app/src/main/java/app/gamenative/service/SteamService.kt
  • app/src/main/java/app/gamenative/ui/model/MainViewModel.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/main/java/app/gamenative/ui/model/MainViewModel.kt
  • app/src/main/java/app/gamenative/service/SteamService.kt

@xXJSONDeruloXx
Copy link
Copy Markdown
Contributor Author

@utkarshdalal done

@utkarshdalal
Copy link
Copy Markdown
Owner

thanks merging

@utkarshdalal utkarshdalal merged commit 37988b3 into utkarshdalal:master May 17, 2026
3 checks passed
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.

3 participants