feat(runtime): tell phones when git status changes (#39672)

* feat(runtime): tell phones when git status changes

* fix(runtime): tell phones about HEAD and packed-refs moves too

* fix(runtime): don't let a phone's status re-read join a read begun before the change

* perf(runtime): limit status-read invalidation to the checkouts an outside change touched

* fix(runtime): match a checkout's status keys under any execution host

* fix(runtime): invalidate globally while a primary checkout is unread

* test(mobile): re-record the Changes and settings goldens on the rebased main

* fix(runtime): invalidate globally while a listed checkout has no cached path

* test: follow the moved paired-client harness

* refactor(mobile): let the host list's catalog read hold the event router
This commit is contained in:
Kelvin Amoaba
2026-11-08 18:36:13 +00:00
committed by GitHub
parent 2aa47c91d2
commit f74bb65fa1
36 changed files with 11699 additions and 6581 deletions
@@ -305,6 +305,12 @@ export function clearGitStatusLineStatsCache(): void {
resetGitStatusLineStatsWriteGenerations()
}
export function clearGitStatusLineStatsCacheKeysWhere(matches: (key: string) => boolean): void {
Array.from(lineStatsByWorktree.keys())
.filter(matches)
.forEach((key) => clearGitStatusLineStatsCacheKey(key))
}
export function clearGitStatusLineStatsCacheKey(
cacheKey: string,
writeToken?: GitStatusLineStatsWriteToken
@@ -64,10 +64,16 @@ export class GitStatusReadLeaseOwner<T> {
}
invalidate(): void {
this.invalidateWhere(() => true)
}
// Later leases start fresh; callers already holding a detached read keep it.
invalidateWhere(matches: (key: string) => boolean): void {
for (const [key, entry] of this.entries) {
this.detach(key, entry)
if (matches(key)) {
this.detach(key, entry)
}
}
this.entries.clear()
}
private createLease(