Commit Graph

5 Commits

Author SHA1 Message Date
Sacha Al Himdani
9ac71f948f Update contact email to hello@probo.com
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2026-06-09 16:45:23 +02:00
Émile Ré
137b63a47e Add cookie detector to JS SDK for automatic cookie discovery
Overrides document.cookie setter to intercept cookie writes and detect
unknown cookies not present in the banner config. Also scans pre-existing
cookies on startup. Detected cookies are debounced and reported in batches
to the detected-cookies endpoint with inferred durations from max-age/expires.

Extracts shared cookie helpers (parseCookieName, parseDuration, isDeletion,
removeCookies) into cookie-utils.ts, used by both activation.ts and
detector.ts. Unifies the duplicated "probo_consent" constant into a single
export from cookie.ts.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-23 10:50:57 +04:00
Émile Ré
d63ce1f68b Fix expired queue entries persisting past MAX_AGE_MS
The flush function pruned expired entries in memory but re-read from
localStorage before writing back, so the age filter was never persisted.
Apply the age cutoff to the final write filter and remove the early
return that skipped the write entirely on full send failure.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-16 14:56:34 +04:00
Émile Ré
eafca11c82 Fix queue flush race condition and missing flush on cookie path
Re-read localStorage after network calls in flush() to avoid
discarding entries added by concurrent enqueue() calls. Also
call flush() in the cookie fast-path of load() so queued
consent retries are always drained.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-16 14:56:33 +04:00
Émile Ré
75996d2dd6 Tune HTTP timeouts and add localStorage consent retry queue
Reduce timeout/retry defaults (5s timeout, 2 retries, 500ms base delay)
to cap worst-case page-load blocking at ~12s instead of ~36s.

Add a localStorage-backed queue that persists failed consent POSTs and
replays them on next page load, closing the compliance gap where a
network failure could permanently lose the server-side audit record.

Signed-off-by: Émile Ré <emile@getprobo.com>
2026-04-16 14:56:33 +04:00