Skip to content

fix: [SDK-5335] reject blank identity strings - #901

Open
abdulraqeeb33 wants to merge 2 commits into
mainfrom
ar/sdk-5335
Open

abdulraqeeb33 wants to merge 2 commits into
mainfrom
ar/sdk-5335

Conversation

@abdulraqeeb33

@abdulraqeeb33 abdulraqeeb33 commented Sep 22, 2026 •

Copy link
Copy Markdown

Description

One Line Summary

Reject null and empty identity strings through one shared helper.

Details

Motivation

Fixes SDK-5335.

string parameters accept null at runtime, and empty strings were forwarded to native on both Android and iOS. Part of SDK-5327.

Scope

InputGuard in the core assembly rejects null and empty for Initialize, Login, and the Android and iOS user and in-app message managers:

  • initialize(appId)
  • login(externalId)
  • addAlias / addAliases (label and id)
  • removeAlias / removeAliases
  • addEmail / removeEmail
  • addSms / removeSms
  • addTag / addTags (key only). An empty tag value is allowed. A null tag value is rejected.
  • removeTag / removeTags
  • addTrigger / addTriggers (key only). An empty trigger value is allowed. A null trigger value is rejected.
  • removeTrigger / removeTriggers
  • trackEvent(name)

Whitespace is still allowed. Editor stubs are unchanged. OneSignal.User is 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. null is 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

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

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>
@abdulraqeeb33
abdulraqeeb33 requested a review from a team as a code owner September 22, 2026 20:36
Empty language is the only reset path. Null is still rejected.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant