[SDK] Rebuild the session core on PasswordSession behind an AtpAgent compat shim (#11343)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-13 22:26:12 +03:00
committed by GitHub
parent 22b31c52bb
commit 97b3978fb8
35 changed files with 6871 additions and 2397 deletions
+12
View File
@@ -31,6 +31,18 @@ export function get<K extends keyof Schema>(key: K): Schema[K] {
}
get satisfies PersistedApi['get']
/**
* Native is single-instance: there is no other tab that could have written
* newer data behind our back, so the in-memory `_state` is already the truth
* and a synchronous fresh read is impossible anyway (AsyncStorage is async).
* This mirrors {@link get}; the web implementation is the one that actually
* re-reads the store.
*/
export function readLatest<K extends keyof Schema>(key: K): Schema[K] {
return _state[key]
}
readLatest satisfies PersistedApi['readLatest']
export async function write<K extends keyof Schema>(
key: K,
value: Schema[K],