mirror of
https://github.com/misiektoja/xbox_monitor.git
synced 2026-04-26 15:35:49 +03:00
[GH-ISSUE #8] Errant "User detected playing a game (via title history)" message after user goes offline #5
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/xbox_monitor#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tomballgithub on GitHub (Feb 7, 2026).
Original GitHub issue: https://github.com/misiektoja/xbox_monitor/issues/8
I wanted to capture this with the latest code. This is a normal user (not appearing offline).
The flow goes correctly, as shown in the long log at the bottom.
But then after the user goes inactive, this immediately pops up:
Full log:
@misiektoja commented on GitHub (Feb 10, 2026):
Ok, hopefully
8533dc638fixes it, let me know!@tomballgithub commented on GitHub (Feb 18, 2026):
It's not clear in the debug messages what the script thinks the last seen time was, but the "offline since Tue 17 Feb 2026, 18:31:58" message does align with the lastonline time of "Tue 17 Feb 2026, 18:30:43".
Can you add one more debug message, along with the other ones occurring every 5 minutes, sharing whether the last active time is title-based or lastonline-based and what that time is?
But still seeing the same behavior of:
@misiektoja commented on GitHub (Feb 18, 2026):
Can you try the new version? It includes enhanced debugging messages that will hopefully allow us to pinpoint the issue. Once it happens again, please share the logs.
@tomballgithub commented on GitHub (Feb 18, 2026):
Running it now. Looks good so far. Will update once account becomes active.
and for account that hides availability, also looks good:
@tomballgithub commented on GitHub (Feb 18, 2026):
Still seeing a problem with debug statements. Waiting for user to go offline.
@tomballgithub commented on GitHub (Feb 19, 2026):
And this captures why it uses 'title', although at startup it was correctly using presence timestamp.
After going active, it thinks presence timestamp is
presence=N/A (missing/zero))In top example, the first debug statements being offline have incorrect data. And it uses title timestamp
[DEBUG 17:36:49] Presence data: state=offline, title_name=, game_name=, platform=, lastonline=N/A (missing/zero)In bottom example, the first debug statements being offline have correct data. And it uses presence timestamp.
[DEBUG 18:11:03] Presence data: state=offline, title_name=, game_name=, platform=XSX, lastonline=Wed 18 Feb 2026, 18:08:08But then later on it worked as expected:
@tomballgithub commented on GitHub (Feb 19, 2026):
Here's an IOS app example where the debug data is shown incorrectly while 'online' but then ok once user drops 'offline':
@misiektoja commented on GitHub (Feb 20, 2026):
Ok, the issue is clear now. The core challenge is that Xbox presence data is inconsistent around transitions: while online, last_seen is empty and right after an online -> offline flip it may briefly arrive missing before updating. I added a short offline grace-retry window, a cached last valid presence timestamp fallback and clearer debug source/confidence tags so we can avoid bad assumptions and see exactly why a timestamp was chosen. This should reduce false title-history fallbacks and make remaining API timing edge cases explicit in logs. Let me know!
@tomballgithub commented on GitHub (Feb 21, 2026):
The end result looks correct, but I have some questions on the debug information
presence_raw is blank until 22:04:34.
lastonline = N/A (missing/zero) until 22:04:34
is this expected when online and it's available when offline?
something happens at 21:32:49 where it thinks user went offline
is this expected? or at least OK?