mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
- app.withSpan(type, [options,] fn): auto-start, ambient parent for everything created inside fn (client + server via virtual startSpan dispatch), auto-end on settle; on throw records data.error and rethrows (telemetry never fails fn) - span-context.ts: AsyncLocalStorage from the BUILT-IN node:async_hooks via a bundler-opaque dynamic import (works on Node/Bun/Deno/Workers/Edge; browsers fall back to a module-level sync stack with documented interleaving limits) - root: true drops all ambient parents; excludeParentIds filters the FINAL merged parent list (an excluded span stays excluded even when re-entering via a kept child's chain) — both on TrackOptions and StartSpanOptions - analytics.waitUntil constructor option: every batch-send promise (browser tracker + server coalescer) is passed to it so un-awaited sends survive serverless teardown; stripped from serialized app options (toClientJson) Tests: 5 span-context cases (ALS nesting across awaits, parallel isolation, sync-stack cleanup), 4 event-tracker cases (withSpan auto-end + ambient parenting, error path, root/exclude final-list semantics, waitUntil hook) |
||
|---|---|---|
| .. | ||
| cli | ||
| dashboard-ui-components | ||
| js | ||
| next | ||
| react | ||
| sc | ||
| shared | ||
| shared-backend | ||
| tanstack-start | ||
| template | ||
| ui | ||