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

[Bug]: Sending tags throws error based on app's limit event if it is only tags updates

Open ThomasEcalle opened this issue 1 year ago • 1 comments

What happened?

Hi,

I am currently working on an app where the user tag limits is now of 20 due to the recent changes on plans limits. The issue is that the only way to update user tags is to "send" tags... and it does not work anymore.

Imagine a user having 11 tags. It seems that calling OneSignal.shared.sendTags(tags); with tags being a list of 10 tags throws an error.

Error deleting tag from OneSignal. Error: PlatformException(OneSignal, Encountered an error updating tags (400): {"errors":["App is limited to a maximum of 20 tags on a given player"],"success":false}, null, null)

Note that, if I understood correctly the way we can update a user tags, this error should not be thrown as the 10 tags I am sending are actually already in the user tags and are just updates, not creations.

I assume that there is maybe an error on the API side, seeing that we send 10 tags and we already have 11 and just throwing an error.

The API should consider the fact that, among these 10 tags, some of them are maybe already existing.

Steps to reproduce?

1. Install an app on version 3.5.1
2. Try to add as many tags as your plan enables you
3. Try to update your tags by calling a second time `OneSignal.shared.sendTags(tags);` with ne values but previous keys
4. It should throw an error saying than you exceed the limit even if these are the same tags

What did you expect to happen?

I expected OneSignal (the API, I guess) to understand that, among the tags I send, some of them are only updates to previously added tags.

The error should only be thrown when previous tags + new tags actually exceed the app limit

OneSignal Flutter SDK version

3.5.1

Which platform(s) are affected?

  • [X] iOS
  • [X] Android

Relevant log output

Error deleting tag from OneSignal. Error: PlatformException(OneSignal, Encountered an error updating tags (400): {"errors":["App is limited to a maximum of 20 tags on a given player"],"success":false}, null, null)

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ThomasEcalle avatar May 05 '23 08:05 ThomasEcalle

@ThomasEcalle Thank you for reporting we will investigate!

emawby avatar May 08 '23 19:05 emawby