Skip to content

When the trackPushOpen event fails due to an expired JWT token it does not attempt to resend it after a new JWT token is set #905

@frankkubista

Description

@frankkubista

Here are the steps to reproduce:

  1. Have an app that uses the Iterable SDK and have it set up to use the JWT token
  2. Have a backend service that sends the app the JWT token to use in the Iterabel SDK (this service must require a valid authentication header from the app after a user has logged in)
  3. Log into the app so it can set an initial Iterable JWT token to the SDK
  4. Close the app and wait for both the Iterable JWT token and app auth token to expire
  5. Send push notification
  6. Click push notification on the device
  7. App opens
  8. App tries to refresh it's authentication token and at the same time the Iterable SDK tries to get new JWT token but since the auth token is expired it can’t get one yet
  9. Iterable tries to send the api/events/trackPushOpen event but gets 401 since the old JWT token is expired
  10. The app auth token is refreshed and we set the user id IterableApi.getInstance().userId = userId which triggers the Iterable SDK to try to get a new JWT token by calling onAuthTokenRequested
  11. The Iterable SDK gets a new JWT token and calls api/inApp/getMessages and api/users/registerDeviceToken which succeed
  12. The Iterable SDK does not try to send api/events/trackPushOpen again

It would be ideal if a request fails due to an expired JWT it should be added to a queue and once a new JWT token is set it should try to resend the failed requests in the queue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions