OneSignal-Android-SDK icon indicating copy to clipboard operation
OneSignal-Android-SDK copied to clipboard

Once removed tags are always added to every next tag upload request

Open putns opened this issue 4 years ago • 3 comments

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:

  1. 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;
  2. Add first tag and wait for OneSignal to upload tags;
  3. Remove first tag and wait for OneSignal to upload tags;
  4. Add second (different) tag and wait for OneSignal to upload tags, and you should see that OneSignal also tries to upload first tag again;
  5. And if you repeat 2.-4. steps multiple times with different tags, you end up with Please limit your tag updates to 100 per request error.

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.

putns avatar Nov 11 '20 17:11 putns

Hey @putns, thanks for your report, we will discuss this problem and go back to you with more information

Jeasmine avatar Nov 16 '20 15:11 Jeasmine

Just confirmed this is still the behavior on latest 4.6.6 release. We will follow up.

nan-li avatar Feb 08 '22 18:02 nan-li

The problem is still there on the version 3.0.4...

askanhan avatar May 13 '22 10:05 askanhan

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!

jennantilla avatar Mar 13 '24 22:03 jennantilla