Repository navigation
Conversation
- Add reset() to clear all local SDK state including device ID - Deprecate removeUserId() in favor of reset()
WalkthroughAdds a new Changes
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/core/Clix.ts (1)
116-127:⚠️ Potential issue | 🟡 MinorCHANGELOG claims
setUserId()acceptsnull, but the implementation doesn't support it.The CHANGELOG (line 15) states "setUserId() now accepts null to remove the user ID", but the method signature at line 107 only accepts
string:static async setUserId(userId: string): Promise<void>Either update the signature to
userId: string | nullwith logic to callremoveProjectUserId()when null, or correct the CHANGELOG to remove this claim.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/Clix.ts` around lines 116 - 127, The CHANGELOG states setUserId() accepts null but the implementation only accepts string; update the API to match the changelog by changing the Clix.setUserId signature to accept userId: string | null and implement the null-handling branch to call this.shared?.deviceService?.removeProjectUserId() (or delegate to the existing Clix.removeUserId() helper) after awaiting Clix.initCoordinator.waitForInitialization(), otherwise keep current behavior and ensure non-null values call the existing deviceService.setProjectUserId(); alternatively, if you prefer not to support null, update the CHANGELOG to remove the claim.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Around line 17-19: Update the implementation and docs to be consistent: change
the setUserId signature in Clix (method setUserId) to accept string|null (or
optional) and implement treating null as clearing the user id (equivalent to
previous removeUserId behavior), update the `@deprecated` JSDoc on removeUserId /
in src/core/Clix.ts to match the CHANGELOG message, and ensure removeUserId is
marked deprecated in favor of setUserId(null) (or keep reset() as an alias if
intended) so CHANGELOG, JSDoc and runtime behavior all align.
---
Outside diff comments:
In `@src/core/Clix.ts`:
- Around line 116-127: The CHANGELOG states setUserId() accepts null but the
implementation only accepts string; update the API to match the changelog by
changing the Clix.setUserId signature to accept userId: string | null and
implement the null-handling branch to call
this.shared?.deviceService?.removeProjectUserId() (or delegate to the existing
Clix.removeUserId() helper) after awaiting
Clix.initCoordinator.waitForInitialization(), otherwise keep current behavior
and ensure non-null values call the existing deviceService.setProjectUserId();
alternatively, if you prefer not to support null, update the CHANGELOG to remove
the claim.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32d818ffd4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/core/Clix.ts`:
- Around line 129-148: The reset() implementation should be best‑effort: call
Clix.initCoordinator.waitForInitialization() in a try block but move all
cleanup/removal and this.initCoordinator.reset() into a finally block so they
run even if waitForInitialization() throws; ensure you still guard nulls
(this.shared?.sessionService?.cleanup(), liveActivityService,
notificationService, storageService.remove(...)) and log the wait error via
ClixLogger.error before proceeding, so cleanup always executes and the
coordinator is reset regardless of initialization failures.
- Around line 129-148: Clix.reset() currently only removes 'clix_device_id' and
'clix_session_last_activity' leaving persisted keys like 'clix_config' and
'clix_current_push_token' behind; update the reset() implementation (in the
Clix.reset method) to also remove 'clix_config' and 'clix_current_push_token'
from this.shared?.storageService before clearing this.shared and calling
this.initCoordinator.reset(); ensure the removals occur after waiting for
initCoordinator.waitForInitialization() and before setting shared to undefined
so all persisted SDK state is cleared as documented.
Summary
Add
reset()method for logout support and deprecateremoveUserId().Changes
reset()method that clears all local SDK state (device ID, session) without server callsremoveUserId()— usereset()insteadreset()toClixInitCoordinatorSpec
https://docs.google.com/document/d/1ET-KqAFQlODNEm08YDXehzfWuqKZsOhnr4NJG-f0P9k/edit?tab=t.0#bookmark=id.9awmqjhnpii6
Summary by CodeRabbit
New Features
Deprecated
Chores