-
Notifications
You must be signed in to change notification settings - Fork 371
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
[question]: Extremely Slow Callbacks On Version 4.8.9 #2074
Comments
@bundleberk The calls back are only fired after the network call is completed. Network calls are delayed by 5 seconds so as many operations can be batched together into a single network call as an optimization. You can call |
Backend sets the tags in our structure unfortunately not the client. In this case I have to wait for approximately 10 seconds to inform the backend that user is subscribed, logged in and ready to be set tags and get notifications. If users kills the app on the first session earlier than 10 seconds they will not be able to get notifications. In this case i will have to use a Worker to send the request even if the app is killed. The callbacks are fired instantly on onesignal 5 though :( |
@bundleberk Splitting up setting values on the player between your backend and your app, especially on create / first start, does make things more complex. In your scenario it has a lot of serial operations that depend on each other. I think moving the tag setting to the client will simply things a bit, and should make this process faster. I don't think I have the full picture of what your needs are and what you are currently doing but I'll fill in the gaps by stating some assumptions to get us on the same page. Let me know if this is right or wrong:
If the above it right I would recommend you instead you pass the tag values you want to set on the OneSignal Player from your login endpoint. So on step 1 above, pass |
mostly correct, 1- I call backend to get an id on app's login this whole process takes like 15 seconds to complete which is too long. thanks for the recommendation it could work better but unfortunately I'm unable to change this structure quickly becuase it involves backend development too, I used a Worker to handle all of these. Which led to this issue. |
Summary, the 5 second delay is by design to optimize network calls. The 15 second delay is due to operations depending on each other, which can be avoided by changing how tags and externalId are used with OneSignal. While there might be a change the SDK could make to make this smoother there isn't plans to make any large changes to the 4.x.x branch, instead this would be better to consider for 5.x.x and future major versions of the SDK. If this scenario is still a concern for User Model (5.x.x) please open a new issue. |
How can we help?
I had to downgrade to OneSignal 4.8.9 because of the bugs that 5.x.x versions had. OSSubscriptionObserver and SetExternalId completion callbacks are extremely slow. SetExternalId callback always triggers after 5 seconds like it is done on purpose. OSSubscriptionObserver is also triggers after 5-10 seconds. Those are very long times since I need to do some other operations like setting tags to the user. Any ideas?
Code of Conduct
The text was updated successfully, but these errors were encountered: