Prevent system theme sync from crashing after Pi reloads - #3
Open
GodGardensGuns wants to merge 1 commit into
Open
Prevent system theme sync from crashing after Pi reloads#3GodGardensGuns wants to merge 1 commit into
GodGardensGuns wants to merge 1 commit into
Conversation
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.
Issue
Pi now marks extension contexts as stale after session replacement or reload.
pi-system-themekeeps a polling interval that captures thectxfromsession_start. If Pi reloads, forks, switches sessions, or otherwise shuts down the current extension runtime while an appearance detection poll is in flight, that async poll can resume later and accessctx.ui.That raises:
In interactive mode this can crash Pi via an uncaught exception.
Fix
session_shutdownctx.ui/system-themesave/apply behavior guarded against stale sessions as wellTesting
npx --yes vitest runAlso added a regression test that simulates shutdown while appearance detection is in flight and verifies the stale
ctx.uiis not accessed.