on-zero 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1045,6 +1045,10 @@ export function createZeroClientInternal<
1045
1045
  scheduleReload?: (ctx: ScheduleReloadContext) => void
1046
1046
  guardStorage?: RecoveryGuardStorage
1047
1047
  benignLogPatterns?: readonly ZeroLogPattern[]
1048
+ // mint a fresh token. REQUIRED for any host that outlives its token: zero
1049
+ // parks in needs-auth and will not resume until the auth string changes,
1050
+ // so without this a long-lived headless host answers 401 forever.
1051
+ refreshAuth?: () => Promise<string | undefined>
1048
1052
  }
1049
1053
  ): { zero: ZeroInstance; close: () => Promise<void> } {
1050
1054
  const {
@@ -1054,6 +1058,7 @@ export function createZeroClientInternal<
1054
1058
  scheduleReload,
1055
1059
  guardStorage,
1056
1060
  benignLogPatterns,
1061
+ refreshAuth,
1057
1062
  ...options
1058
1063
  } = props
1059
1064
  // mutations read auth dynamically through getAuthData(), so this has to be
@@ -1069,9 +1074,11 @@ export function createZeroClientInternal<
1069
1074
  })
1070
1075
  publishZeroInstance(zeroInstance)
1071
1076
  zeroInstanceVersion?.emit(zeroInstanceVersion.value + 1)
1077
+ const unwatch = watchZeroConnection({ zeroInstance, refreshAuth })
1072
1078
  return {
1073
1079
  zero: zeroInstance,
1074
1080
  close: async () => {
1081
+ unwatch()
1075
1082
  clearZeroInstanceReferences(zeroInstance)
1076
1083
  mutationLifecycle.fence()
1077
1084
  await zeroInstance.close()
@@ -1079,13 +1086,145 @@ export function createZeroClientInternal<
1079
1086
  }
1080
1087
  }
1081
1088
 
1089
+ // watch a zero instance's connection and own the generic recovery: stale-poke
1090
+ // and transport reconnects, needs-auth token refresh, reconnect-status events,
1091
+ // and optional dataset mirroring. plain subscription, no react — a headless
1092
+ // host needs exactly this and previously got none of it, so its token expiry
1093
+ // ended as a permanent 401 with no way back.
1094
+ function watchZeroConnection(args: {
1095
+ zeroInstance: ZeroInstance
1096
+ refreshAuth?: () => Promise<string | undefined>
1097
+ exposeDataset?: boolean
1098
+ datasetCacheUrl?: string
1099
+ }): () => void {
1100
+ const { zeroInstance, refreshAuth, exposeDataset, datasetCacheUrl } = args
1101
+ let prevState = zeroInstance.connection.state.current.name
1102
+ let hasConnected = false
1103
+ const currentReconnect =
1104
+ zeroEvents.value?.type === 'reconnect' && zeroEvents.value.status !== 'connected'
1105
+ ? zeroEvents.value
1106
+ : null
1107
+ let reconnect: { reasonKey: ZeroReconnectReasonKey; reason: string } | null =
1108
+ currentReconnect
1109
+ ? { reasonKey: currentReconnect.reasonKey, reason: currentReconnect.reason }
1110
+ : null
1111
+ // one reconnect per distinct recoverable error / one refresh per needs-auth
1112
+ // transition, so a stuck state doesn't retry-storm.
1113
+ let recoverableError: string | null = null
1114
+ let needsAuth = false
1115
+
1116
+ const handle = () => {
1117
+ const state = zeroInstance.connection.state.current
1118
+ const name = state.name
1119
+ const reason =
1120
+ 'reason' in state && typeof state.reason === 'string' ? state.reason : ''
1121
+
1122
+ // mirror connection state onto the body dataset for e2e/diagnostics
1123
+ // (enabled on one instance so instances don't clobber each other).
1124
+ if (exposeDataset && typeof document !== 'undefined' && document.body) {
1125
+ document.body.dataset.zeroState = name
1126
+ if (datasetCacheUrl) document.body.dataset.zeroCacheUrl = datasetCacheUrl
1127
+ if (reason) document.body.dataset.zeroReason = reason.slice(0, 200)
1128
+ else delete document.body.dataset.zeroReason
1129
+ if (name === 'connected') document.body.dataset.zeroConnected = 'true'
1130
+ else delete document.body.dataset.zeroConnected
1131
+ }
1132
+
1133
+ if (name === 'connected') {
1134
+ hasConnected = true
1135
+ recoverableError = null
1136
+ if (reconnect) {
1137
+ reconnect = null
1138
+ emitReconnectStatus({ type: 'reconnect', status: 'connected' })
1139
+ }
1140
+ }
1141
+
1142
+ const reconnectReasonKey: ZeroReconnectReasonKey | undefined = reason.includes(
1143
+ 'ServerOverloaded'
1144
+ )
1145
+ ? 'server-overloaded'
1146
+ : reason.includes('Failed to fetch') ||
1147
+ reason.includes('fetch failed') ||
1148
+ reason.includes('NetworkError when attempting to fetch resource') ||
1149
+ reason.includes('Network request failed') ||
1150
+ reason.includes('Load failed')
1151
+ ? 'transport'
1152
+ : undefined
1153
+
1154
+ // stale-poke and paused transport errors both resume the existing client.
1155
+ // ServerOverloaded remains in Zero's own retry/backoff loop.
1156
+ if (
1157
+ name === 'error' &&
1158
+ (isRecoverableZeroStalePokeMessage(reason) || reconnectReasonKey)
1159
+ ) {
1160
+ if (recoverableError !== reason) {
1161
+ recoverableError = reason
1162
+ reconnect = { reasonKey: reconnectReasonKey ?? 'transport', reason }
1163
+ emitReconnectStatus({ type: 'reconnect', status: 'trying', ...reconnect })
1164
+ void Promise.resolve(zeroInstance.connection?.connect?.()).catch(() => {})
1165
+ }
1166
+ return
1167
+ }
1168
+ if (name !== 'error') recoverableError = null
1169
+
1170
+ if (name === 'connecting' && (reconnect || hasConnected || Boolean(reason))) {
1171
+ reconnect = {
1172
+ reasonKey: reconnectReasonKey ?? reconnect?.reasonKey ?? 'transport',
1173
+ reason: reason || reconnect?.reason || 'connection interrupted',
1174
+ }
1175
+ emitReconnectStatus({
1176
+ type: 'reconnect',
1177
+ status: reason ? 'waiting' : 'trying',
1178
+ ...reconnect,
1179
+ })
1180
+ } else if (name === 'disconnected' && (reconnect || hasConnected)) {
1181
+ reconnect = {
1182
+ reasonKey: reconnect?.reasonKey ?? 'transport',
1183
+ reason: reason || reconnect?.reason || 'connection interrupted',
1184
+ }
1185
+ emitReconnectStatus({ type: 'reconnect', status: 'waiting', ...reconnect })
1186
+ }
1187
+
1188
+ // needs-auth: the token expired and zero won't auto-resume unless the
1189
+ // auth string changes. refresh it and reconnect in place, once.
1190
+ if (name === 'needs-auth') {
1191
+ if (refreshAuth && !needsAuth) {
1192
+ needsAuth = true
1193
+ void refreshAuth()
1194
+ .then((token) => {
1195
+ if (token) zeroInstance.connection?.connect?.({ auth: token })
1196
+ })
1197
+ .catch(() => {})
1198
+ }
1199
+ } else {
1200
+ needsAuth = false
1201
+ }
1202
+
1203
+ if (name !== prevState) {
1204
+ prevState = name
1205
+ if (name === 'error' || name === 'needs-auth') {
1206
+ zeroEvents.emit({
1207
+ type: 'error',
1208
+ reasonKey:
1209
+ name === 'needs-auth' ? 'connection-needs-auth' : 'connection-error',
1210
+ message: reason || name,
1211
+ })
1212
+ }
1213
+ }
1214
+ }
1215
+
1216
+ const unsubscribe = zeroInstance.connection.state.subscribe(handle)
1217
+ handle()
1218
+ return unsubscribe
1219
+ }
1220
+
1082
1221
  // monitors connection state and emits events (replaces onError callback removed
1083
1222
  // in 0.25). also owns the generic-Zero connection recovery that used to live in
1084
1223
  // each consumer: stale-poke reconnect, needs-auth token refresh, and optional
1085
1224
  // e2e dataset bookkeeping.
1086
1225
  const ConnectionMonitor = memo(
1087
1226
  ({
1088
- zeroEvents,
1227
+ zeroEvents: _zeroEvents,
1089
1228
  refreshAuth,
1090
1229
  exposeDataset,
1091
1230
  datasetCacheUrl,
@@ -1096,146 +1235,19 @@ export function createZeroClientInternal<
1096
1235
  datasetCacheUrl?: string
1097
1236
  }) => {
1098
1237
  const zeroInstance = useZero<Schema, ZeroMutators>()
1099
- const state = useConnectionState()
1100
- const prevState = useRef(state.name)
1101
- const hasConnectedRef = useRef(false)
1102
- const currentReconnect =
1103
- zeroEvents.value?.type === 'reconnect' && zeroEvents.value.status !== 'connected'
1104
- ? zeroEvents.value
1105
- : null
1106
- const reconnectRef = useRef<{
1107
- reasonKey: ZeroReconnectReasonKey
1108
- reason: string
1109
- } | null>(
1110
- currentReconnect
1111
- ? {
1112
- reasonKey: currentReconnect.reasonKey,
1113
- reason: currentReconnect.reason,
1114
- }
1115
- : null
1238
+ // the recovery logic itself is not react's — it is a subscription to the
1239
+ // instance's connection state, shared with connectHeadless so a non-react
1240
+ // host recovers identically instead of going dark on token expiry.
1241
+ useEffect(
1242
+ () =>
1243
+ watchZeroConnection({
1244
+ zeroInstance,
1245
+ refreshAuth,
1246
+ exposeDataset,
1247
+ datasetCacheUrl,
1248
+ }),
1249
+ [zeroInstance, refreshAuth, exposeDataset, datasetCacheUrl]
1116
1250
  )
1117
- // one reconnect per distinct recoverable error / one refresh per
1118
- // needs-auth transition, so a stuck state doesn't retry-storm.
1119
- const recoverableErrorRef = useRef<string | null>(null)
1120
- const needsAuthRef = useRef(false)
1121
-
1122
- useEffect(() => {
1123
- const name = state.name
1124
- const reason =
1125
- 'reason' in state && typeof state.reason === 'string' ? state.reason : ''
1126
-
1127
- // mirror connection state onto the body dataset for e2e/diagnostics
1128
- // (enabled on one instance so instances don't clobber each other).
1129
- if (exposeDataset && typeof document !== 'undefined' && document.body) {
1130
- document.body.dataset.zeroState = name
1131
- if (datasetCacheUrl) document.body.dataset.zeroCacheUrl = datasetCacheUrl
1132
- if (reason) document.body.dataset.zeroReason = reason.slice(0, 200)
1133
- else delete document.body.dataset.zeroReason
1134
- if (name === 'connected') document.body.dataset.zeroConnected = 'true'
1135
- else delete document.body.dataset.zeroConnected
1136
- }
1137
-
1138
- if (name === 'connected') {
1139
- hasConnectedRef.current = true
1140
- recoverableErrorRef.current = null
1141
- if (reconnectRef.current) {
1142
- reconnectRef.current = null
1143
- emitReconnectStatus({ type: 'reconnect', status: 'connected' })
1144
- }
1145
- }
1146
-
1147
- const reconnectReasonKey: ZeroReconnectReasonKey | undefined = reason.includes(
1148
- 'ServerOverloaded'
1149
- )
1150
- ? 'server-overloaded'
1151
- : reason.includes('Failed to fetch') ||
1152
- reason.includes('fetch failed') ||
1153
- reason.includes('NetworkError when attempting to fetch resource') ||
1154
- reason.includes('Network request failed') ||
1155
- reason.includes('Load failed')
1156
- ? 'transport'
1157
- : undefined
1158
-
1159
- // stale-poke and paused transport errors both resume the existing
1160
- // client. ServerOverloaded remains in Zero's own retry/backoff loop.
1161
- if (
1162
- name === 'error' &&
1163
- (isRecoverableZeroStalePokeMessage(reason) || reconnectReasonKey)
1164
- ) {
1165
- if (recoverableErrorRef.current !== reason) {
1166
- recoverableErrorRef.current = reason
1167
- reconnectRef.current = {
1168
- reasonKey: reconnectReasonKey ?? 'transport',
1169
- reason,
1170
- }
1171
- emitReconnectStatus({
1172
- type: 'reconnect',
1173
- status: 'trying',
1174
- ...reconnectRef.current,
1175
- })
1176
- void Promise.resolve(zeroInstance.connection?.connect?.()).catch(() => {})
1177
- }
1178
- return
1179
- }
1180
- if (name !== 'error') recoverableErrorRef.current = null
1181
-
1182
- if (
1183
- name === 'connecting' &&
1184
- (reconnectRef.current || hasConnectedRef.current || Boolean(reason))
1185
- ) {
1186
- reconnectRef.current = {
1187
- reasonKey:
1188
- reconnectReasonKey ?? reconnectRef.current?.reasonKey ?? 'transport',
1189
- reason: reason || reconnectRef.current?.reason || 'connection interrupted',
1190
- }
1191
- emitReconnectStatus({
1192
- type: 'reconnect',
1193
- status: reason ? 'waiting' : 'trying',
1194
- ...reconnectRef.current,
1195
- })
1196
- } else if (
1197
- name === 'disconnected' &&
1198
- (reconnectRef.current || hasConnectedRef.current)
1199
- ) {
1200
- reconnectRef.current = {
1201
- reasonKey: reconnectRef.current?.reasonKey ?? 'transport',
1202
- reason: reason || reconnectRef.current?.reason || 'connection interrupted',
1203
- }
1204
- emitReconnectStatus({
1205
- type: 'reconnect',
1206
- status: 'waiting',
1207
- ...reconnectRef.current,
1208
- })
1209
- }
1210
-
1211
- // needs-auth: the token expired and zero won't auto-resume unless the
1212
- // auth string changes. refresh it and reconnect in place, once.
1213
- if (name === 'needs-auth') {
1214
- if (refreshAuth && !needsAuthRef.current) {
1215
- needsAuthRef.current = true
1216
- void refreshAuth()
1217
- .then((token) => {
1218
- if (token) zeroInstance.connection?.connect?.({ auth: token })
1219
- })
1220
- .catch(() => {})
1221
- }
1222
- } else {
1223
- needsAuthRef.current = false
1224
- }
1225
-
1226
- if (name !== prevState.current) {
1227
- prevState.current = name
1228
- if (name === 'error' || name === 'needs-auth') {
1229
- zeroEvents.emit({
1230
- type: 'error',
1231
- reasonKey:
1232
- name === 'needs-auth' ? 'connection-needs-auth' : 'connection-error',
1233
- message: reason || name,
1234
- })
1235
- }
1236
- }
1237
- }, [state, zeroEvents, zeroInstance, refreshAuth, exposeDataset, datasetCacheUrl])
1238
-
1239
1251
  return null
1240
1252
  }
1241
1253
  )
@@ -57,6 +57,7 @@ export declare function createZeroClient<Schema extends ZeroSchema, Models exten
57
57
  scheduleReload?: ((ctx: ScheduleReloadContext) => void) | undefined;
58
58
  guardStorage?: RecoveryGuardStorage;
59
59
  benignLogPatterns?: readonly ZeroLogPattern[];
60
+ refreshAuth?: (() => Promise<string | undefined>) | undefined;
60
61
  }) => {
61
62
  zero: ZeroClient<Schema, GetZeroMutators<Models>, unknown>;
62
63
  close: () => Promise<void>;
@@ -118,6 +119,7 @@ export declare function createZeroClientInternal<Schema extends ZeroSchema, Mode
118
119
  scheduleReload?: (ctx: ScheduleReloadContext) => void;
119
120
  guardStorage?: RecoveryGuardStorage;
120
121
  benignLogPatterns?: readonly ZeroLogPattern[];
122
+ refreshAuth?: () => Promise<string | undefined>;
121
123
  }) => {
122
124
  zero: ZeroClient<Schema, GetZeroMutators<Models>, unknown>;
123
125
  close: () => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"createZeroClient.d.ts","sourceRoot":"","sources":["../src/createZeroClient.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,IAAI,UAAU,EACnB,MAAM,gBAAgB,CAAA;AAOvB,OAAO,EASL,KAAK,OAAO,EACZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAK/D,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAA;AAIpC,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAg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