@tracelog/lib 0.11.4 → 0.11.5

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.
Files changed (2) hide show
  1. package/README.md +16 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -184,12 +184,22 @@ window.__traceLogDisabled = true;
184
184
 
185
185
  [Full Security Guide →](./SECURITY.md)
186
186
 
187
- ## Error Handling
188
-
189
- - **4xx errors** - Events discarded (no retry)
190
- - **5xx/network errors** - Events persist in localStorage for next-page recovery
191
- - **Page unload** - Uses `sendBeacon()` for reliable delivery
192
- - **Event expiry** - Persisted events expire after 2 hours
187
+ ## Error Handling & Reliability
188
+
189
+ TraceLog uses a **persistence-based recovery model** with no in-session retries:
190
+
191
+ - **Success (2xx)** - Events sent immediately, queue cleared
192
+ - **Permanent errors (4xx)** - Events discarded immediately (invalid data won't succeed on retry)
193
+ - **Temporary errors (5xx/network)** - Events removed from queue and persisted to localStorage
194
+ - **Recovery** - Persisted events automatically recovered and retried on next page load
195
+ - **Expiration** - Persisted events expire after 2 hours
196
+ - **Page unload** - Uses `sendBeacon()` for synchronous delivery of session end events
197
+
198
+ **Why no in-session retries?**
199
+ - Prevents infinite retry loops during API outages
200
+ - Reduces server load and network traffic during failures
201
+ - Better battery life on mobile devices
202
+ - Natural recovery on page navigation (common in SPAs)
193
203
 
194
204
  ## Debug
195
205
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tracelog/lib",
3
3
  "description": "JavaScript library for web analytics and real-time event tracking",
4
4
  "license": "MIT",
5
- "version": "0.11.4",
5
+ "version": "0.11.5",
6
6
  "main": "./dist/public-api.cjs",
7
7
  "module": "./dist/public-api.js",
8
8
  "types": "./dist/public-api.d.ts",