OneSignal-Android-SDK
OneSignal-Android-SDK copied to clipboard
Once removed tags are always added to every next tag upload request
Description:
Once removed tags are always added to tag upload request. Seems like OneSignal preserves every removed tag. Expected result would be that OneSignal does not preserve any removed tag that was once removed. In long run, if more tags are added and removed and OneSignal preserves removed, eventually it leads to problem, where OneSignal will not upload tags as there is 100 tag limit from server side.
Added tag - 6E62-PNYAaePVp6-L54X:
D/OneSignal: OneSignalRestClient: PUT SEND JSON: {"tags":{"6E62-PNYAaePVp6-L54X":"true"},"app_id":"***"}
Removed same tag - 6E62-PNYAaePVp6-L54X:
D/OneSignal: OneSignalRestClient: PUT SEND JSON: {"tags":{"6E62-PNYAaePVp6-L54X":""},"app_id":"***"}
Added different tag - 6E62-UymKFjFK9h-4W9Q, tag - 6E62-PNYAaePVp6-L54X is still present in request:
D/OneSignal: OneSignalRestClient: PUT SEND JSON: {"tags":{"6E62-PNYAaePVp6-L54X":"","6E62-UymKFjFK9h-4W9Q":"true"},"app_id":"***"}
And eventually, if more tags are added and removed, this is show in logcat, when OneSignal tries to upload more than 100 tags:
W/OneSignal: OneSignalRestClient: PUT RECEIVED JSON: {"errors":["Please limit your tag updates to 100 per request"],"success":false}
Environment OneSignal v3.15.2
Steps to Reproduce Issue:
- Set OneSignal log level to debug
OneSignal.setLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.NONE)to be able to see requests, which OneSignal makes; - Add first tag and wait for OneSignal to upload tags;
- Remove first tag and wait for OneSignal to upload tags;
- Add second (different) tag and wait for OneSignal to upload tags, and you should see that OneSignal also tries to upload first tag again;
- And if you repeat 2.-4. steps multiple times with different tags, you end up with
Please limit your tag updates to 100 per requesterror.
Anything else:
Same problem was already reported, but no action was taken: https://github.com/OneSignal/OneSignal-Android-SDK/issues/829. There is comment: https://github.com/OneSignal/OneSignal-Android-SDK/issues/829#issuecomment-526338981 that recommends to space out requests. I assume, the commentator thought that problem is with amount of tags what application tries to add/remove, but the problem happens, because OneSignal adds every previously removed tag. Even, if application tries to add 1 tag, OneSignal will attach to request more tags - the removed tags, if there is any.
Hey @putns, thanks for your report, we will discuss this problem and go back to you with more information
Just confirmed this is still the behavior on latest 4.6.6 release. We will follow up.
The problem is still there on the version 3.0.4...
Hello everyone, apologies that this issue has gone stale. Much of our work since 2023 H2 has been on our latest major release where many improvements and enhancements are introduced. We will continue to investigate 4.x.x bugs, though we encourage you to update to 5.1.6 as that will be the most-supported release going forward. Please see our migration guide for full details and let us know if you have any questions!