mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user