@edraj/sauron-browser 1.0.0 → 1.4.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 +72 -0
- package/README.md +1008 -53
- package/dist/index.cjs +285 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -13
- package/dist/index.d.ts +142 -13
- package/dist/index.js +281 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,78 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@edraj/sauron-browser` are documented here.
|
|
4
4
|
|
|
5
|
+
## 1.4.0
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **`captureMessage()` poisoned the entire envelope.** It sent an `exception`
|
|
10
|
+
block with `type: null`, but the gateway's `ExceptionInfo.ty` is a
|
|
11
|
+
non-optional string with no default, so the envelope failed to deserialize and
|
|
12
|
+
was rejected whole (`400 invalid_envelope`) — taking every unrelated error,
|
|
13
|
+
event and transaction batched alongside it. Every SDK treats a 400 as
|
|
14
|
+
non-retryable, so the batch was dropped without a retry and without a trace.
|
|
15
|
+
A message item now carries no `exception` block at all and puts its text in
|
|
16
|
+
`message`, which is the shape the Python SDK already sent.
|
|
17
|
+
|
|
18
|
+
Worth knowing before you upgrade: this also changes server-side grouping.
|
|
19
|
+
Messages now fingerprint on their normalized text instead of piling into one
|
|
20
|
+
bucket keyed by a synthetic exception type, so existing message issues will
|
|
21
|
+
re-split into separate issues.
|
|
22
|
+
- **A failed offline-queue drain silently deleted the rest of the backlog.**
|
|
23
|
+
`drain()` empties `localStorage` in one shot, so from that point the parked
|
|
24
|
+
envelopes exist only in a local array — and a send failure re-parked just the
|
|
25
|
+
payload that had failed before returning, discarding every payload behind it.
|
|
26
|
+
The whole untried remainder is now re-parked, at the head, preserving the
|
|
27
|
+
oldest-first order the byte-cap eviction policy depends on. This is the plain
|
|
28
|
+
reconnect-then-one-500 case the queue exists for. A 401/403 mid-drain now
|
|
29
|
+
keeps the backlog too — the credentials may be fixed and the client
|
|
30
|
+
re-inited — and logs a warning instead of disabling in silence.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- The anonymous id is now persisted in `localStorage` under `sauron.anon_id`
|
|
35
|
+
instead of being re-minted in memory on every page load. **Every web app's
|
|
36
|
+
reported active-user count drops sharply and permanently on the day this is
|
|
37
|
+
adopted** — the old behaviour counted page loads, not people (a 5-10x
|
|
38
|
+
inflation, all of it in the "guest" half of the Active Users report). The
|
|
39
|
+
drop is a data artifact, not a regression.
|
|
40
|
+
- The anonymous id is a durable first-party identifier stored on the user's
|
|
41
|
+
terminal. That is a retention and consent consequence, not just an
|
|
42
|
+
implementation detail.
|
|
43
|
+
- `ExceptionValue.type` is `string`, no longer `string | null`, and `ErrorItem`
|
|
44
|
+
gained an optional `message`. A TypeScript caller that builds these by hand
|
|
45
|
+
will now see a type error where it previously compiled — passing `null` there
|
|
46
|
+
is precisely what produced the envelope rejection above.
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
|
|
50
|
+
- `reset()` — clears the scope user and mints a fresh anonymous id.
|
|
51
|
+
**Call it on logout.** `setUser(null)` now calls it for you. Without it, the
|
|
52
|
+
next anonymous visitor on a shared browser reuses the persisted id and a
|
|
53
|
+
later `identify()` aliases their activity to the previous account,
|
|
54
|
+
server-side, permanently.
|
|
55
|
+
- `anonymous_id` is sent on the identify item only when the anonymous id was
|
|
56
|
+
actually used as a `distinct_id` in this browser session.
|
|
57
|
+
|
|
58
|
+
## 1.3.0
|
|
59
|
+
|
|
60
|
+
- **Workflows** — bound a named span of activity with start / end / cancel, and
|
|
61
|
+
read the active one back. Every event, error and transaction captured while a
|
|
62
|
+
workflow is active is stamped with its `workflow_id` / `workflow_name`, so the
|
|
63
|
+
dashboard can group a whole flow (`checkout`, `password_reset`, …) as one unit.
|
|
64
|
+
Entirely optional: an app that never starts a workflow behaves exactly as before.
|
|
65
|
+
- **`beforeSend` can no longer throw into your app.** A hook that raises is logged
|
|
66
|
+
and the item is sent unmodified, rather than the exception escaping through the
|
|
67
|
+
capture call. Returning `null` still drops the item as before.
|
|
68
|
+
|
|
69
|
+
## 1.2.0
|
|
70
|
+
|
|
71
|
+
- **Breaking: the `environment` option has been removed.** An environment is now
|
|
72
|
+
identified by the ingest key it belongs to, not by a string the client sends.
|
|
73
|
+
Create environments in the dashboard under app settings; each one has its own
|
|
74
|
+
DSN. Delete `environment` from your `init` call and swap in the DSN of the
|
|
75
|
+
environment you want to report to.
|
|
76
|
+
|
|
5
77
|
## 1.0.0 - 2026-07-27
|
|
6
78
|
|
|
7
79
|
First public release. Prior `0.x` versions were internal-only and were never
|