Skip to content

Defer session history loading until monitoring starts - #21

Closed
ivan-magda wants to merge 1 commit into
ResistanceTo:masterfrom
ivan-magda:fix/defer-session-history
Closed

ivan-magda wants to merge 1 commit into
ResistanceTo:masterfrom
ivan-magda:fix/defer-session-history

Conversation

@ivan-magda

Copy link
Copy Markdown

Move the session-history load from PowerMonitor.init to its first foreground start(). Background-only Get Reading invocations use fresh sensor data and no longer request the saved history.

Set the request flag before scheduling the task so a pause and restart cannot start a second load. The history task stays separate from the sensor tick; restoration, merging, deletion protection and the save gate keep their existing behavior.

The cold Shortcuts-to-foreground transition still needs a device check.

Fixes #20.

@ivan-magda ivan-magda closed this Oct 12, 2026
@ivan-magda
ivan-magda deleted the fix/defer-session-history branch October 12, 2026 20:29
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.

Background Get Reading requests session history it does not use

1 participant