Repository navigation
Conversation
This was referenced Oct 8, 2026
|
0xbrayo
force-pushed
the
fix/session-long-durations
branch
from
October 8, 2026 19:37
a0fc856 to
b1d5d89
Compare
Member
Author
SessionParser discarded any session of 4 hours or more, losing genuine long sessions (navigation, video, reading). The cap guarded against a missing PAUSE keeping a session open overnight; close the open session on SCREEN_NON_INTERACTIVE and DEVICE_SHUTDOWN instead, and keep only a 24h sanity bound. The state machine moves to a pure function so it can be unit-tested.
…ssions Same-app re-resume keeps the original start, another app's resume ends the session without a pause, a stale pause from another app is ignored, and the trailing open session is not emitted.
0xbrayo
force-pushed
the
fix/session-long-durations
branch
from
October 11, 2026 13:13
4bac96d to
c1ea654
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #333.
SessionParserdropped any session at or aboveMAX_REASONABLE_SESSION_DURATION(4 hours). Genuine long sessions, such as navigation, video or a reading app, disappeared from the timeline entirely. The cap was a guard against a session staying open because itsACTIVITY_PAUSEDnever arrived, but turning the screen off is a much tighter and more accurate bound.Change
SCREEN_NON_INTERACTIVEandDEVICE_SHUTDOWN, and either one ends the open session. Nothing is in the foreground once the screen is off, whether or not the app's PAUSE was recorded.parseForegroundSessions(events, appName)so it can be unit-tested without aContext;SessionParserdelegates to it. Behaviour is otherwise unchanged.Testing
ForegroundSessionsTest: a 5-hour session is kept, and screen-off ends a session whose PAUSE never arrives. I confirmed both fail with the old 4h cap and no screen-off handling../gradlew :mobile:testStandardDebugUnitTestpasses.