Skip to content

Commit f3604f5

Browse files
committed
docs: clarify storage path fallback semantics
1 parent b241012 commit f3604f5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/storage/path-state.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ let currentStorageState: StoragePathState = {
1717
};
1818

1919
export function getStoragePathState(): StoragePathState {
20+
// Keep the last synchronously assigned state as a fallback until enterWith()
21+
// has propagated through the current async chain. This is intentionally a
22+
// best-effort bridge for immediate reads; callers should still set state
23+
// before spawning child work and treat AsyncLocalStorage as the source of truth.
2024
return storagePathStateContext.getStore() ?? currentStorageState;
2125
}
2226

0 commit comments

Comments
 (0)