You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a read-only global-sync accessor for cache-only call sites that need to inspect an existing child store without creating, bootstrapping, or pinning a directory store.
The immediate motivating case is PR #471: sidebar timestamp calculation can safely read already-loaded message cache, but it should not need to expand child-store lifecycle just to discover that a directory cache is absent.
Scope
In scope:
Investigate current globalSync.child(...), children.child(...), and children.peek(...) semantics.
Add a clearly named accessor for "existing child store only" if the investigation confirms cache-only callers need it.
The accessor should return undefined or an equivalent safe empty result when the child store does not already exist.
It must not call ensureChild(...) for missing directories.
PR fix(app): use last user message time in sidebar #471 uses globalSync.child(session.directory, { bootstrap: false, pin: false }) for sidebar timestamp reads. That avoids bootstrap and pinning, but still creates/touches an unpinned child store because child() calls ensureChild(...).
Goal
Add a read-only global-sync accessor for cache-only call sites that need to inspect an existing child store without creating, bootstrapping, or pinning a directory store.
The immediate motivating case is PR #471: sidebar timestamp calculation can safely read already-loaded message cache, but it should not need to expand child-store lifecycle just to discover that a directory cache is absent.
Scope
In scope:
globalSync.child(...),children.child(...), andchildren.peek(...)semantics.undefinedor an equivalent safe empty result when the child store does not already exist.ensureChild(...)for missing directories.Out of scope:
globalSync.childcall sites mechanically. Audit each cache-only caller separately.child()behavior for normal callers that intentionally create/bootstrap/pin stores.Relevant files or context
Relevant files:
packages/app/src/context/global-sync/child-store.tspackages/app/src/context/global-sync/types.tspackages/app/src/context/global-sync.tsxpackages/app/src/context/sync.tsxpackages/app/src/pages/layout.tsxpackages/app/src/pages/layout/pawwork-session-source.tsRelated:
globalSync.child(session.directory, { bootstrap: false, pin: false })for sidebar timestamp reads. That avoids bootstrap and pinning, but still creates/touches an unpinned child store becausechild()callsensureChild(...).layout.tsxcontroller extraction and should not be blocked on this low-priority cache accessor unless the same area is being touched.Verification
session.time.created.bun --cwd packages/app test --preload ./happydom.tswith the targeted test files.bun --cwd packages/app typecheck.git diff --check.Execution mode
Agent should investigate and propose a plan first