fix: recover mobile and sync state after resume
Reconnect sync stream when native mobile app resumes Materialize incomplete sessions with explicit recovery reasons Add low-noise debug breadcrumb for scoped recovery
This commit is contained in:
@@ -23,7 +23,7 @@ function isSyncDebugEnabled(): boolean {
|
||||
}
|
||||
return _enabled
|
||||
}
|
||||
type SyncDebugCategory = "pipeline" | "reducer" | "dispatch"
|
||||
type SyncDebugCategory = "pipeline" | "reducer" | "dispatch" | "recovery"
|
||||
|
||||
function log(cat: SyncDebugCategory, ...args: unknown[]): void {
|
||||
if (!isSyncDebugEnabled()) return
|
||||
@@ -74,4 +74,10 @@ export const syncDebug = {
|
||||
eventApplied: (eventType: string, sessionID?: string, messageID?: string) =>
|
||||
log("dispatch", "event → applied", { eventType, sessionID, messageID }),
|
||||
},
|
||||
|
||||
recovery: {
|
||||
/** A scoped session snapshot fetch is starting because live state looked incomplete. */
|
||||
materializing: (details: { reason: string; directory: string; sessionID: string; messageID?: string; partID?: string }) =>
|
||||
log("recovery", "materializing session", details),
|
||||
},
|
||||
} as const
|
||||
|
||||
Reference in New Issue
Block a user