Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix onesignalid is local when identity verification off #2242

Open
wants to merge 1 commit into
base: identity_verification_beta
Choose a base branch
from

Conversation

jinliu9508
Copy link
Contributor

@jinliu9508 jinliu9508 commented Jan 10, 2025

Description

One Line Summary

Fix a bug that a local onesignal ID is used for logging in when identity verification is turned off.

Details

Motivation

The beta for identity verification has a bug that incorrectly uses a local OneSignal ID in a login request. This may result in a 400 error and cause the login to fail. Some users who unknowingly adopt the beta version may experience a change in behavior. This PR aims to resolve the bug in the beta and ensure stability for the identity verification feature, whether it is enabled or disabled.

Scope

Added a check for the useIdentityVerification status before composing a login request.

Testing

Manual testing

Steps to reproduce the bug with a 400 error:

  1. Install 5.1.26 and login an arbitrary user. Observe that the logging in is successful.
  2. Ensure the identity verification is turned off in the OneSignal dashboard.
  3. Upgrade to 5.2.0-beta. Observe that the logging in is still successful.
  4. Call Logout() and observe the 400 error returned from the server.
    After the fix, we no longer receive the 400 error and the logout is successful.

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
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • 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.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

@jinliu9508 jinliu9508 added the WIP Work In Progress label Jan 10, 2025
@jinliu9508 jinliu9508 changed the base branch from main to identity_verification_beta January 13, 2025 18:41
@jinliu9508 jinliu9508 changed the title WIP: Fix onesignalid is local identity verification off WIP: Fix onesignalid is local when identity verification off Jan 13, 2025
@jinliu9508 jinliu9508 requested review from jkasten2 and nan-li January 13, 2025 19:02
@jinliu9508 jinliu9508 changed the title WIP: Fix onesignalid is local when identity verification off Fix onesignalid is local when identity verification off Jan 13, 2025
@nan-li
Copy link
Contributor

nan-li commented Jan 16, 2025

This is tagged WIP, is it still in WIP?

@jinliu9508 jinliu9508 removed the WIP Work In Progress label Jan 16, 2025
@jinliu9508
Copy link
Contributor Author

This is tagged WIP, is it still in WIP?

I just removed the tag and it is now ready for review.

Copy link
Contributor

@nan-li nan-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you test a new install using this branch with identity verification turned off?

I am getting an immediate 400 on the user creation request - the push subscription is missing. May be reproducible or just me.

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