Skip to content

SDK-412 UUA Naming inconsistencies#576

Open
joaodordio wants to merge 1 commit intomainfrom
fix/SDK-412-UUA-Naming-inconsistencies
Open

SDK-412 UUA Naming inconsistencies#576
joaodordio wants to merge 1 commit intomainfrom
fix/SDK-412-UUA-Naming-inconsistencies

Conversation

@joaodordio
Copy link
Copy Markdown
Member

@joaodordio joaodordio commented Apr 28, 2026

JIRA Ticket(s) if any

Description

Aligns the Web SDK with the cross-SDK Unknown User Activation (UUA) naming convention. No behavior changes. Old public surface kept as deprecated aliases; legacy on-disk data is migrated transparently on first read.

Renames

  • Config flag: enableUnknownActivation is now enableUnknownUserActivation. Old name kept as a deprecated alias; if both are supplied, the new one wins. Setting the legacy name emits a console.warn.
  • localStorage key: unknown_userId is now itbl_userid_unknown (matches the itbl_* convention used by every other Web key).
  • Session storage JSON fields inside itbl_unknown_sessions: number_of_sessions / first_session / last_session are now totalUnknownSessionCount / firstUnknownSession / lastUnknownSession (already what the payload types and backend expect; the rename layer in createUnknownUser is gone).
  • Constant: AUA_WARNING is now UUA_WARNING. Old export kept as a deprecated alias.

Migrations

  • New migrateLegacyKey(oldKey, newKey) helper in utils/commonFunctions.ts, invoked once at SDK init for the unknown user id key.
  • updateUnknownSession reads legacy snake_case fields as fallback and rewrites under the new camelCase keys.

Tests

  • New commonFunctions.test.ts covering the migration helper (idempotent, no overwrite of new key, no-op when neither exists).
  • New tests in config.test.ts for the deprecated config alias path.
  • New session field migration test in unknownUserEventManager.test.ts.
  • README and react-example updated.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.19608% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.56%. Comparing base (190a168) to head (d5da516).

Files with missing lines Patch % Lines
src/unknownUserTracking/unknownUserEventManager.ts 78.57% 3 Missing ⚠️
src/commerce/commerce.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #576      +/-   ##
==========================================
+ Coverage   74.45%   74.56%   +0.11%     
==========================================
  Files          57       57              
  Lines        2736     2760      +24     
  Branches      798      811      +13     
==========================================
+ Hits         2037     2058      +21     
- Misses        698      701       +3     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joaodordio joaodordio marked this pull request as ready for review April 29, 2026 00:44
@joaodordio joaodordio requested a review from mprew97 as a code owner April 29, 2026 00:44
@joaodordio joaodordio self-assigned this Apr 29, 2026
@joaodordio joaodordio requested a review from lposen April 29, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants