@oneuptime/react-native-replay 14.0.11 → 14.0.13

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.
package/README.md CHANGED
@@ -193,11 +193,16 @@ const diagnostics = OneUptimeReplay.getDiagnostics();
193
193
 
194
194
  Diagnostics contain recorder decisions and fixed reason codes, not view text.
195
195
  Pass `debug: true` at startup to mirror those codes to the development console.
196
+ `status` is `"paused"` while capture is paused because nobody is using the app,
197
+ and while a session that ended idle waits for the user to come back (see
198
+ [Durability and lifecycle](#durability-and-lifecycle)). The codes
199
+ `idle-paused`, `idle-resumed` and `session-ended-idle` mark those transitions.
196
200
 
197
201
  Use the current consented session ID to correlate the application's own traces
198
202
  and logs with replay. The listener fires immediately when a session exists,
199
- again on every rotation, and with `null` when capture stops or consent is
200
- withdrawn:
203
+ again on every rotation, and with `null` when capture stops, consent is
204
+ withdrawn, or the session ends idle (the next session's ID arrives when the
205
+ user is back, or with `captureSession()`):
201
206
 
202
207
  ```ts
203
208
  const unsubscribe = OneUptimeReplay.onSessionChange((sessionId) => {
@@ -221,6 +226,36 @@ server response. AppState backgrounding records visibility, closes the current
221
226
  chunk, drains the outbox only when policy and consent permit uploading, and
222
227
  pauses sampling; foregrounding resumes with a fresh full snapshot.
223
228
 
229
+ Five minutes without input pauses capture altogether, so an app left on
230
+ screen costs neither battery nor upload. The open chunk closes with an
231
+ `oneuptime.idle-paused` marker and the sampler stops: nothing is sampled,
232
+ checked out, uploaded or recorded until someone is back. Events the app raises
233
+ meanwhile (`track()`, `setRoute()`, JavaScript errors) are dropped, not queued,
234
+ and an error while paused triggers no upload. Input - a touch, the soft
235
+ keyboard showing or hiding, or the app returning to the foreground - resumes
236
+ the same session on a fresh full snapshot followed by an
237
+ `oneuptime.idle-resumed` marker, so the player shows the gap as unrecorded
238
+ rather than as a screen that sat still.
239
+
240
+ Thirty minutes with no touch and no recorded SDK call ends the session at that
241
+ last activity - for a paused session, at the pause, where its footage ended -
242
+ so time in the background or paused is never added to the end of a session,
243
+ and nothing is sent dated after it. No session starts while nobody is there:
244
+ the user's next touch, keyboard, return to the foreground, or
245
+ `captureSession()` starts a new one on a fresh full snapshot.
246
+
247
+ Keystrokes on the soft keyboard reach no view the SDK can observe, so the
248
+ keyboard itself stands in for them: its showing and hiding count as input, and
249
+ capture never pauses while it is up, however long someone types. (The
250
+ 30-minute session rollover does not depend on it.)
251
+
252
+ `captureSession()` while paused resumes capture at once, on a fresh snapshot
253
+ with the `oneuptime.idle-resumed` marker and then its own marker behind it; if
254
+ the session has already ended idle, it starts the next session first and the
255
+ marker lands there. Under the error/frustration trigger it also starts the
256
+ upload, opening on that snapshot. It is not input, so if nobody is there the
257
+ next check pauses capture again.
258
+
224
259
  Policy is revalidated without HTTP-cache reuse before every foreground resume,
225
260
  after identity changes, and at five-minute intervals while the app remains
226
261
  active. An explicit disable takes effect before more capture; a transient