mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-02 13:07:46 +00:00
The same browser was several people. 0.3.14 moved the bundled client's anonymous
id onto a cookie shared across *.hanzo.ai, but two other implementations of the
same idea kept running: hz.js minted into hz_id — a key of its own, so a page
carrying both it and the npm client sent two anonymous ids for one visitor — and
the tag hanzoai/cloud hosts at /v1/event.js had a third resolution over the
shared key, so an origin carrying only the tag stayed split from everything else.
The chain now lives in src/anon.js and nothing else implements it:
- src/storage.ts imports it; anonId() is a call.
- hz.js has no bundler, so it inlines the marked region VERBATIM, and
src/anon.test.ts compares the two byte for byte.
- hanzoai/cloud vendors the same file for its tag.
Resolution is cookie · localStorage hz_anon_id · localStorage hz_id · in-memory ·
mint. Every id already in a browser is ADOPTED and only a browser holding none is
given a new one, so no returning visitor is reset — including the ones who have
only ever met hz.js, whose hz_id is carried onto the shared key instead of being
orphaned beside it.
hz.js also drops its restated UUIDv7 minter and uid.ts re-exports the chain's, so
the version nibble the plane's session rollups admit cannot diverge between
distributions. sessionId() is unchanged: a session stays origin-local.
Co-authored-by: Hanzo Dev <[email protected]>
15 lines
378 B
Plaintext
15 lines
378 B
Plaintext
dist
|
|
node_modules
|
|
.next
|
|
build
|
|
.contentlayer
|
|
**/fixtures
|
|
deprecated
|
|
apps/v4/registry/styles/**/*.css
|
|
|
|
# Byte-coupled: hz.js carries the marked region of src/anon.js VERBATIM, and
|
|
# pkgs/event/src/anon.test.ts compares them byte for byte. Reformatting either
|
|
# one alone breaks the build; the same region is also vendored by hanzoai/cloud.
|
|
pkgs/event/src/anon.js
|
|
pkgs/event/hz.js
|