feat(analytics): build-time bake + telemetry depth (#336)

Bake PostHog + Sentry into the published Docker image (SNAPOTTER_ANALYTICS
build arg, codegen script). Delete entire consent system. Move event emission
to BullMQ worker. Add cross-tier identity stitching, Sentry performance
tracing on both tiers, frontend funnel events. Fix stateful regex bug.

86 files changed, 1593 insertions(+), 3747 deletions(-)
This commit is contained in:
SnapOtter
2026-06-24 11:05:39 +08:00
committed by GitHub
parent a53038ed96
commit 5d36ac06d8
86 changed files with 1594 additions and 3748 deletions
-25
View File
@@ -136,31 +136,6 @@ describe("formatHeaders", () => {
expect(headers.get("Authorization")).toBeNull();
});
it("includes analytics consent header when no token and consent is set to true", () => {
storageMap.set("snapotter-analytics-consent", "true");
const headers = formatHeaders();
expect(headers.get("X-Analytics-Consent")).toBe("true");
});
it("includes analytics consent header when consent is false", () => {
storageMap.set("snapotter-analytics-consent", "false");
const headers = formatHeaders();
expect(headers.get("X-Analytics-Consent")).toBe("false");
});
it("does not include analytics consent header when token exists", () => {
storageMap.set("snapotter-token", "tok");
storageMap.set("snapotter-analytics-consent", "true");
const headers = formatHeaders();
expect(headers.get("X-Analytics-Consent")).toBeNull();
});
it("does not include analytics consent header when consent is not true/false", () => {
storageMap.set("snapotter-analytics-consent", "remind");
const headers = formatHeaders();
expect(headers.get("X-Analytics-Consent")).toBeNull();
});
it("merges provided HeadersInit with auth headers", () => {
storageMap.set("snapotter-token", "tok");
const headers = formatHeaders({ "Content-Type": "application/json" });