Added key customId to set the custom Id for OUL#479
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
@KambleSonam can you mention the steps on how this has been tested exactly with steps? This would help the QA and Reviewers |
singhkunal2050
left a comment
There was a problem hiding this comment.
Can we make the public api argument consistent for OUL with init
Refer https://github.com/CleverTap/clevertap-web-sdk/blob/master/src/clevertap.js#L683, we are using customId
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| this.wzrkError.c = code; | ||
| this.wzrkError.d = description; | ||
| this.info("".concat(CLEVERTAP_INFO_PREFIX, " ").concat(code, ": ").concat(description)); | ||
| } |
There was a problem hiding this comment.
reportInfo still sets wzrkError, sending info as server errors
Medium Severity
The new reportInfo method sets this.wzrkError.c and this.wzrkError.d identically to reportError. Because addSystemDataToObject sends any non-empty wzrkError as wzrk_error in every API payload, informational events (like NULL_VALUE_REMOVED and EMPTY_VALUE_REMOVED) are still transmitted to the server as error data. The change from reportError to reportInfo only affects the console log level; the server-side error reporting behavior is unchanged.
| let sendOULFlag = true | ||
| StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag) | ||
| const addToK = (ids) => { | ||
| const addToK = (ids, customIdFlag = false) => { |
There was a problem hiding this comment.
Is default false the base case?


Changes
To handle the customId in the OUL flow, customer can add the field, customId in OUL call.
The customId will be verified, sanitised and would be set as the Clevertap Id, which will be used for subsequent calls.
Changes to Public Facing API if any
OUL call will have the parameter customId
How Has This Been Tested?
Checklist
Link to Deployed SDK
Use these url for testing :
https://static.wizrocket.com/staging/task/WEB-3904/customId_OUL/js/clevertap.min.jshttps://static.wizrocket.com/staging/task/WEB-3904/customId_OUL/js/sw_webpush.min.jsHow to trigger Automations
Just add a empty commit after all your changes are done in the PR with the command
git commit --allow-empty -m "[run-test] Testing Automation"This will trigger the automation suite
Note
Medium Risk
Touches identity/session linkage in the OUL flow by changing how
gcookieis set and persisted, which can affect user attribution if validation/prefixing or cache interactions are wrong. Logging changes are low risk but may impact integrations that rely on error-level signals.Overview
Adds support for passing
customIdinonUserLoginpayloads: the value is validated (length/charset), lowercased, prefixed for web, then used to set/override the storedgcookiefor subsequent requests while avoiding cache-basedgcookieoverwrites during OUL when a custom ID is present.Introduces
Logger.reportInfowith an "info" prefix and changes null/empty-property removal reporting fromreportErrortoreportInfoto reduce error-level noise. Also bumps the SDK version strings to2.5.4and updatesCHANGELOG.md.Written by Cursor Bugbot for commit 10197f7. This will update automatically on new commits. Configure here.