TrajectoryRequestBlobStore class final

Writes and rotates one session's request blobs over ExecutionEnv.

Constructors

TrajectoryRequestBlobStore({required ExecutionEnv env, required String? sessionId(), int maxBytes = trajectoryRequestBlobMaxBytes, int ttlDays = trajectoryRequestBlobTtlDays, DateTime clock()?})
Creates a store. sessionId resolves lazily per write (the capture can fire before the session exists); maxBytes bounds the dir's total size, ttlDays its age — the rotation policy sweeps only when a write crosses the budget or a sweep hour elapses, so a healthy session never pays a per-request directory walk.

Properties

hashCode → int
The hash code for this object.
no setterinherited
maxBytes → int
Per-session blob-dir byte budget.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
ttlDays → int
Blob age bound in days.
final

Methods

enforceBudget() → Future<int>
Enforces the rotation policy NOW: expired blobs go first (age past ttlDays), then oldest-by-mtime until the dir fits maxBytes. Returns the deleted count; every failure is swallowed (rotation is hygiene, never a correctness path).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readDetail(String path) → Future<TrajectoryRequestDetail?>
The full detail stored in path; null when the file is missing or corrupt (a rotated-away or torn blob degrades the Request tab to the record's lightweight metadata — never a crash).
readWireDump(String path) → Future<TrajectoryWireDump?>
The wire dump stored in path; null when absent or corrupt.
sweepExpiredEverywhere() → Future<int>
Deletes every blob past ttlDays in EVERY session's request dir under .fah/trajectories/. Unlike enforceBudget there is no newest-kept grace: a dead session keeps nothing past the TTL. Returns the deleted count; every failure is swallowed (hygiene, never a correctness path).
sweepOncePerBoot() → Future<void>
The boot-time TTL sweep (gh-1745 review): enforceBudget advances only while a session keeps receiving requests, so an ENDED session's blobs would age forever — the disk-footprint tail the ticket complains about survives at the directory level. Runs at most once per store instance (the store is built lazily at the first request of a session, which is the host's "session open"); best-effort.
toString() → String
A string representation of this object.
inherited
write({required TrajectoryRequestDetail detail, String? rawWireDump, String redactWireDump(String)?}) → Future<TrajectoryRequestSpill?>
Writes detail (plus the built rawWireDump, when the request carried one) as one JSON blob and returns the spill outcome. Null on any write failure — the caller falls back to the legacy inline persistence (AC6 shape: the capture is never lost, never a crash).

Operators

operator ==(Object other) → bool
The equality operator.
inherited