fix: [SDK-5335] reject blank identity strings - #901
Open
abdulraqeeb33 wants to merge 2 commits into
Open
abdulraqeeb33 wants to merge 2 commits into
abdulraqeeb33 wants to merge 2 commits into
Conversation
Blank login, app id, language, alias, email, sms, tag key, trigger key, and custom event names were forwarded to native. One helper now drops those calls on Android and iOS. Co-authored-by: Cursor <cursoragent@cursor.com>
Empty language is the only reset path. Null is still rejected. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Reject null and empty identity strings through one shared helper.
Details
Motivation
Fixes SDK-5335.
stringparameters accept null at runtime, and empty strings were forwarded to native on both Android and iOS. Part of SDK-5327.Scope
InputGuardin the core assembly rejects null and empty forInitialize,Login, and the Android and iOS user and in-app message managers:initialize(appId)login(externalId)addAlias/addAliases(label and id)removeAlias/removeAliasesaddEmail/removeEmailaddSms/removeSmsaddTag/addTags(key only). An empty tag value is allowed. A null tag value is rejected.removeTag/removeTagsaddTrigger/addTriggers(key only). An empty trigger value is allowed. A null trigger value is rejected.removeTrigger/removeTriggerstrackEvent(name)Whitespace is still allowed. Editor stubs are unchanged.
OneSignal.Useris not wrapped, so existing event subscriptions stay on the same instance.setLanguage("")is not rejected. It is the reset to the device language, and there is no other reset path.nullis still rejected.Testing
Unit testing
No Unity test runner in this environment. The helper is the same check used by the other SDK PRs, and the call sites return before the native bridge.
Manual testing
Not run. Needs a Unity editor or device build.
Affected code checklist
Checklist
Overview
Testing
Final pass