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

[Bug]: console shows PATCH request with 409 Conflict result after cache clear (160001) #1093

Open
lmeurs opened this issue Aug 18, 2023 · 3 comments

Comments

@lmeurs
Copy link

lmeurs commented Aug 18, 2023

What happened?

The first time a page with our OneSignal implementation is loaded after clearing browser cache + cookies, the console shows a 409 Conflict error:

OneSignalApiBase.js:67 PATCH https://onesignal.com/api/v1/apps/800f295a-a6b2-49c9-9fb1-2555e1e8df91/users/by/onesignal_id/e99029ac-39b1-459c-9409-0b5c48cb78ab/identity 409

image

The URL shows the following message:

{"errors":[{"title":"No aliases found for oneSignalID e99029ac-39b1-459c-9409-0b5c48cb78ab"}]}

Our test OneSignal account only contains 4 subscriptions, none of them indeed has OneSignal ID e99029ac-39b1-459c-9409-0b5c48cb78ab. Sidenotes:

  1. The error no longer occurs after reloading the page
  2. The OneSignal ID changes each time when reproducing this

What browsers are you seeing the problem on?

Chrome (Chromium)

What operating system are you running?

W11

Steps to reproduce?

See description

What did you expect to happen?

No error

Relevant log output

No response

@lmeurs lmeurs changed the title [Bug]: console shows PATCH request with 409 result after cache clear (160001) [Bug]: console shows PATCH request with 409 Conflict result after cache clear (160001) Aug 18, 2023
@jkasten2
Copy link
Member

@lmeurs Thanks for reporting!

Looking to get a few more details to reproduce this issue:

  1. Does the error only happen after calling OneSignal.User.addAlias?
  2. Does it happen consistently?
  1. The OneSignal ID changes each time when reproducing this

To answer your question on this, it is expected to get a new id each time the browser's cache and cookie / data is cleared. Since there is nothing in the browser left to know it is the same user.

@lmeurs
Copy link
Author

lmeurs commented Aug 20, 2023

Hi @jkasten2, this indeed seems to happen consistently.

The user is logged in successfully using OneSignal.login(123456). See screenshot: after the user logs in we do not query OneSignal users (on purpose at least), we only initialize the user by requesting an own API. That the 409 error is between two log messages about initializing the user is probably due to a promise being resolved asynchronously (see Notifications.prototype.apiRequestToInitNotificationUser in /js/notifications.js of the POC we shared with you).

image

You say:

[...] there is nothing in the browser left to know it is the same user

But we log the user in with an external ID, so the browser should be able to know the correct OneSignal user ID, but appears to lookup the user with a completely different OneSignal user ID which does not represent any user in our account. Heck, we currently only have 1 user in our test account with a different user ID. :-)

@lmeurs
Copy link
Author

lmeurs commented Aug 29, 2023

Hi @jkasten2, is there anything else we can do to help you investigate this issue?

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

No branches or pull requests

2 participants