You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c697ace
Browse filesBrowse the repository at this point in the historyBrowse files
Session log: don't count failures nobody saw as errors
A network failure (`s: 0`, not a cancellation) is now an `offlineFailure`, counted as a request rather than an error, when the client reported `online: false` or `visibility: 'hidden'`, or when its batch reached the server more than `OFFLINE_LAG_MS` (60 s) after the request. The logger flushes every 10 s, so normal batches arrive within ~16 s; disky saw `Failed to fetch` batches arrive 164-1151 s late with `online: true` from a laptop closed mid-refresh.
`isFailedApi` / `isErrorEvent` take an optional `receivedMs`. The D1 ingest (`n_errors`), the activity bridge (which passes it on to a custom `event` mapper) and the session viewer all apply it. The viewer gets it as `_received_ms` on each stored event, a name no client field can take. The rule matches disky's `offlineFailure` (cw `42fb2748`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyJyzSYpRxJuL6x6NyjpG3
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -234,7 +234,7 @@ slog('movie.queued', { query, format })
234
234
235
235
The identity on every batch is the request's (`identify`), never the client's. App events must be declared on the server: the client drops undeclared ones and undeclared fields, and the server refuses them, so an app event can't carry an arbitrary object. `filterEvents`, `onStored` (run through `waitUntil`) and `onPurge` hook in an app's own muting, activity feed and derived tables.
236
236
237
-
Fetch cancellations remain visible as `cancelled` without inflating error counts. Explicit `AbortError` is classified immediately; other network failures wait up to five seconds so an intervening `pagehide` can classify them as navigation cancellations. That is a client heuristic, not proof that backend work stopped. Failures on a surviving page remain errors. Benign ResizeObserver scheduling reports are dropped by the client. Anonymous config reads never trigger retention writes, including opted-in public viewers.
237
+
Fetch cancellations remain visible as `cancelled` without inflating error counts. Explicit `AbortError` is classified immediately; other network failures wait up to five seconds so an intervening `pagehide` can classify them as navigation cancellations. That is a client heuristic, not proof that backend work stopped. Failures on a surviving page remain errors, unless nobody could have seen them fail (`offlineFailure`): the browser reported itself offline, the tab was hidden, or the batch reached the server over a minute (`OFFLINE_LAG_MS`) after the request, as when a laptop is closed mid-request. Those count as requests, not errors, in the session list, the viewer and the activity bridge. Each failed request also records `online`, `visibility` and, after a tab resume, `visible_ms`. Benign ResizeObserver scheduling reports are dropped by the client. Anonymous config reads never trigger retention writes, including opted-in public viewers.
238
238
239
239
The migrations are a track of their own (`migrations/session-log/`), so apps that don't use the session log carry no tables for it. Apply the track in order through your migration system (or copy into your app's sequence). `0002_actor.sql` adds nullable `grant_id`/`subject_name`: apply it once after `0001_session_log.sql` before deploying this version, including existing disky-shaped databases. Do not blindly re-run the ALTER statements. `fromGate` attaches trusted recipient identity, and the viewer's filter matches email, recipient name and grant ID; the private grant memo is never used. Old rows are not retrospectively attributed. The summary row tracks the tab's latest identity, not immutable per-event identity evidence.
/** Batches normally arrive within ~16 s (the logger flushes every 10 s); a failure received later than this was reported by a device that went to sleep or offline. */
/** An event as the viewer gets it: tagged with its page load, batch, and when the server received that batch (`_`: no client field can take the name). */
0 commit comments