Repository navigation
perf(system): stop rewriting the session directory while a session runs - #227
Merged
Merged
Conversation
Every session.updated during a run changed the session's updatedAt, which was part of the published directory entry, so Home republished it: the quick actions were removed and re-added, the controls refreshed, and the directory file and AppSearch docs rewritten. Ports iOS #307 (464576fa): entries carry no session times (the list order already says which is newest), and the publisher drops a publish identical to its last job. AppSearch documents no longer set a creation time from updatedAt. Verified: vm.sh check (full) passes; the ported tests anEntryThatComesOutTheSameIsntPublishedAgain and aRunOnTheNewestSessionChangesNoEntry fail without the fix.
The publisher dropped a publish identical to its last job, so after an in-app language change (the activity recreates in the same process) the quick actions kept their old labels. Publish jobs now carry the locale. Also from review: the drawer churn test keeps the iOS name and checks the share targets too; the parity rows note what 464576fa parts Android skips and list SystemChurnTests.swift. Verified: vm.sh check (full) passes; the new locale step fails with the locale left out of the job.
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 a session runs, every
session.updatedmoved itsupdatedAt. That time was part of the entry Home publishes to the system, so each update rewrote the shortcuts' session directory file and re-put the changed AppSearch documents. It also reloaded and compared the controls' copy and the launcher's quick actions, though those already skipped writing when nothing they show had changed.Now the published entry has no session times, because the list order already shows which session is newest. The publisher also drops a publish that matches its last one. A run only republishes when it moves a session up the list. A publish records the app's language, so changing the language in Settings still relabels the quick actions.
One side effect: AppSearch documents no longer use the session's update time as their creation time, so they get the time they were indexed. OpenCode doesn't rank by it. A launcher that sorts search results by creation time could list a re-indexed old session above a newer one (not checked on any launcher).
This ports iOS #307 (464576fa), only the system-directory part. Home still builds the entry on the main thread (iOS moved that off the main actor), and the Live Update step throttle is a separate PR.
Verified:
scripts/check.shpasses on the VM. The ported testsanEntryThatComesOutTheSameIsntPublishedAgainandaRunOnTheNewestSessionChangesNoEntryOrShareTargetsfail without the fix. Nothing changes on screen, so there's no media.