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

chore: add warning for identity verification #901

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

zvikarp
Copy link
Contributor

@zvikarp zvikarp commented Jun 13, 2024

Description

One Line Summary

This method is misleading. it is not implemented but the package exposes it. Please remove it or annotate it.

Details

Errors from Android in device logs:

06-12 23:50:13.470 21589 21742 D OneSignal: [DefaultDispatcher-worker-2] HttpClient: Got Response = POST https://api.onesignal.com/apps/<REDUCTED-UUID>/users - FAILED STATUS: 400
06-12 23:50:13.478 21589 21742 W OneSignal: [DefaultDispatcher-worker-2] HttpClient: Got Response = POST - STATUS: 400 - Body: {"errors":[{"title":"uuid: incorrect UUID length 42 in string \"local-<REDUCTED-UUID>\""}]}

Error from iOS in API request:

curl:

curl 'https://api.onesignal.com/apps/<REDUCTED-UUID>/users' \
-X POST \
-H 'Host: api.onesignal.com' \
-H 'Connection: keep-alive' \
-H 'Accept: application/vnd.onesignal.v1+json' \
-H 'SDK-Version: onesignal/ios/050200' \
-H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
-H 'User-Agent: stern/77 CFNetwork/1496.0.7 Darwin/23.5.0' \
-H 'Content-Type: application/json' \
--cookie '__cf_bm=<REDUCTED-COOKIE>' \
--data-raw '{"refresh_device_metadata":true,"subscriptions":[{"test_type":1, [...] ":"iOSPush"}],"properties":{"timezone_id":"Asia\/Jerusalem","language":"en-IL"},"identity":{}}' \
--proxy http://localhost:9495

response:

{
    "errors": [
        {
            "code": "auth-1",
            "title": "This operation requires 'Authorization' in the HTTP header"
        }
    ]
}

Documentation that mentions it is not implemented: https://documentation.onesignal.com/docs/identity-verification.

Motivation

I spent hours trying to figure out why I'm getting null for onesignal id, no errors in the code logging but different errors from device logs and apis for ios and android didn't help either.

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

@zvikarp
Copy link
Contributor Author

zvikarp commented Jun 13, 2024

this is related to OneSignal/OneSignal-Android-SDK#1913

@zvikarp
Copy link
Contributor Author

zvikarp commented Jun 26, 2024

Hi @jennantilla @nan-li or the rest of the team, is there any blocker form merging this?

@nan-li
Copy link
Contributor

nan-li commented Jun 26, 2024

Hi @zvikarp thanks for submitting this PR, this method should not have been exposed when the functionality is not yet ready.

@nan-li nan-li self-requested a review June 26, 2024 15:55
@nan-li nan-li self-assigned this Jun 26, 2024
@nan-li nan-li requested review from jennantilla and jkasten2 June 26, 2024 15:56
@jennantilla jennantilla merged commit 354cdfa into OneSignal:main Jul 3, 2024
2 checks passed
@jennantilla jennantilla mentioned this pull request Jul 3, 2024
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.

4 participants