Skip to content

perf(system): stop rewriting the session directory while a session runs - #227

Merged
Tarquinen merged 3 commits into
devfrom
system-publication-unchanged
Nov 21, 2026
Merged

Tarquinen merged 3 commits into
devfrom
system-publication-unchanged

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

While a session runs, every session.updated moved its updatedAt. 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.sh passes on the VM. The ported tests anEntryThatComesOutTheSameIsntPublishedAgain and aRunOnTheNewestSessionChangesNoEntryOrShareTargets fail without the fix. Nothing changes on screen, so there's no media.

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.
@Tarquinen Tarquinen changed the title perf(system): stop republishing shortcuts while a session runs perf(system): stop rewriting the session directory while a session runs Nov 20, 2026
@Tarquinen
Tarquinen merged commit d018ddd into dev Nov 21, 2026
2 checks passed
@Tarquinen
Tarquinen deleted the system-publication-unchanged branch November 21, 2026 03:19
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.

1 participant