Repository navigation
perf(system): send Live Update steps at most every 1.5 s - #223
Merged
Merged
Conversation
While an agent worked, the session's ongoing notification was reposted for every new step. Android drops an app's notification updates that come too fast, so a later, important one (Needs your input, Done) could be lost. SessionActivityStepThrottle now sits behind SessionLiveActivityClient.update: a working run's step-only changes go out at most once per 1.5 s (the latest wins). A start, rename, Needs your input, Done, Failed or end goes at once in place of a held step, and a held step goes out when the app leaves the foreground (ProcessLifecycleOwner pause). Ports iOS #307 (464576fa). Verified: ported iOS SessionActivityStepThrottleTests into SessionLiveActivityTests (3 of 4 fail with the hold disabled); full scripts/check.sh on the VM; on an emulator with session-lab and the session-live-activity experiment, a send posts the session-run notification, it settles to Done, and going Home doesn't crash.
… flushes Review follow-up. The throttle's shared instance is now a file-private lazy behind SessionLiveActivityClient.Key, not a module-visible singleton. The KDoc and parity row now say that ProcessLifecycleOwner reports leaving the foreground about 0.7 s after the last activity pauses. The system parity Tests table gets the SessionActivityStepThrottleTests row and the real total (118). Verified: full scripts/check.sh on the VM.
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.
While an agent works, the session's Live Update was reposted for every new step. Android drops notification updates that come too fast, so an important one like Needs your input or Done could get lost.
Now step changes go out at most every 1.5 s, and the latest step wins. A start, rename, Needs your input, Done, Failed or end still goes at once. A held step also goes out when the app leaves the foreground. Android reports that about 0.7 s after the last activity pauses. Ports iOS #307 (464576fa).
Known limitation: with two windows each following its own run, the single notification already switches between the runs on every update (
LiveSessionActivitytreats a different run as a takeover). This PR doesn't change that.Only the timing changes, so there's no media.
Verified
SessionActivityStepThrottleTestsintoSessionLiveActivityTestswith the same test names. 3 of the 4 fail when the hold is turned off.scripts/check.shon the VM.session-live-activityexperiment: a send posts the session-run notification, it settles to Done, and going Home doesn't crash.