We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba1b35a commit f547cc9Copy full SHA for f547cc9
packages/sdk/src/utils/observability.ts
@@ -111,15 +111,14 @@ async function getDistinctId(
111
// Fall through to API key hash
112
}
113
114
+ // Don't cache the fallback — a transient /users/me failure should not poison the cache for the entire process lifetime
115
const hash = createHash("sha256").update(apiKey).digest("hex").slice(0, 16);
- const result = {
116
+ return {
117
identity: {
118
distinct_id: `apikey-${hash}`,
119
distinct_id_source: "api_key_hash",
120
},
121
};
- identityCache.set(apiKey, result);
122
- return result;
123
124
125
export function _resetIdentityCache() {
0 commit comments