@edraj/sauron-node 1.0.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,66 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@edraj/sauron-node` are documented here.
4
+
5
+ ## 1.0.0 - 2026-07-27
6
+
7
+ First public release. Prior `0.x` versions were internal-only and were never
8
+ published to npm.
9
+
10
+ - **Renamed to `@edraj/sauron-node`.** The wire identity is unchanged — the SDK
11
+ still reports itself as `sauron-node` in the envelope header — so the rename
12
+ is invisible to the ingest gateway and the dashboard.
13
+ - **Fixed: a full send queue could wedge the transport permanently.** The whole queue went
14
+ out as one envelope and `413` was treated as retryable, so once the buffer filled during
15
+ an outage every flush resent the same oversized body and failed identically — no event was
16
+ ever delivered again. A 413 now halves the envelope and re-buffers instead of retrying
17
+ unchanged, and a single item that still will not fit is dropped rather than looping.
18
+ - **Fixed: an oversized envelope could delete the entire offline backlog.** Exceeding the
19
+ server's 1000-item limit is a non-retryable `400`, which committed the batch and unlinked
20
+ every persisted file. Envelopes are now capped at `maxItemsPerEnvelope` (default 1000) and
21
+ the queue drains in chunks.
22
+
23
+ ## 0.3.0
24
+
25
+ Parity release — brings the server SDK up to the Browser/Flutter feature bar and
26
+ reconciles the wire shape against `backend/crates/sauron-core/src/envelope.rs`.
27
+
28
+ ### Added
29
+
30
+ - **Scope + per-request isolation** via `AsyncLocalStorage`: `withScope`,
31
+ `configureScope`, `setUser`, `setTag`, `setTags`, `setContext`, `setExtra`.
32
+ Concurrent requests no longer leak user/tags/breadcrumbs into each other.
33
+ - **Breadcrumbs**: `addBreadcrumb` on the active scope (bounded ring buffer,
34
+ default 100) with an optional `beforeBreadcrumb(crumb)` hook. Captured errors
35
+ now attach the scope's breadcrumb trail (previously always `[]`).
36
+ - **`beforeSend(item, hint?)`** hook running on every outgoing item
37
+ (`error | event | identify | transaction`); return `null` to drop.
38
+ - **`trackTransaction(input)`** — manual performance transactions
39
+ (`envelope.rs::TransactionItem`), with `distinct_id` falling back to the
40
+ scoped user's id.
41
+ - **Opt-in auto-capture** (`autoCaptureUnhandled`, default off): captures
42
+ `uncaughtException` / `unhandledRejection` with `mechanism.handled = false`.
43
+ Never swallows the crash — Node's default exit is preserved when the SDK is
44
+ the sole handler.
45
+ - **Opt-in graceful shutdown** (`autoShutdown`, default off) plus the exported
46
+ `installShutdownHooks(client)` / `installAutoCapture(client)` helpers wiring
47
+ `beforeExit`/`SIGTERM`/`SIGINT` to `close()`.
48
+ - **Gzip transport**: request bodies over `gzipThresholdBytes` (default 1024)
49
+ are gzipped with `Content-Encoding: gzip`.
50
+ - **Retry/backoff policy**: exponential backoff + jitter on 408/413/429/5xx and
51
+ network errors, honoring `Retry-After`; drop (no retry) on 400/401/403/404.
52
+ - **Bounded send queue** (`maxQueueBytes`, default 1 MiB, drop-oldest) with
53
+ **opt-in disk persistence** (`offlineDir`) for at-least-once delivery across
54
+ restarts.
55
+
56
+ ### Changed
57
+
58
+ - Error items reconciled to the canonical `envelope.rs::ErrorItem` field set:
59
+ real `breadcrumbs`, `tags`, `user` from scope plus an optional `fingerprint`
60
+ override. Guarded by a new golden-envelope fixture test (`test/envelope.test.ts`).
61
+ - SDK version reported on the wire header bumped to `0.3.0`.
62
+
63
+ ## 0.1.0
64
+
65
+ - Initial server-side SDK: `init`, `track`, `captureException`,
66
+ `captureMessage`, `identify`, buffered background transport.