Skip to content
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

SKU SDK: Credentials refresh is forced due to request id conflict #35742

Closed
evq opened this issue Jan 31, 2024 · 5 comments · Fixed by brave/brave-core#21847 or brave/brave-core#21887
Closed
Assignees
Labels
bug feature/SKUs OS/Android Fixes related to Android browser functionality OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass-Win64 QA/Yes release-notes/exclude

Comments

@evq
Copy link
Member

evq commented Jan 31, 2024

Description

Users are prompted to refresh their credentials due to the background refresh failing with a request id conflict

Steps to Reproduce

  1. Purchase premium leo subscription, do not restore on any other devices.
  2. Wait three days.
  3. Attempt to use your leo subscription

Actual result:

Notice that the refresh notification is triggered despite using a single device.

Expected result:

The background refresh should succeed and the subscription should be usable.

Reproduces how often:

Always

Desktop Brave version:

Android Device details:

  • Install type (ARM, x86):
  • Device type (Phone, Tablet, Phablet):
  • Android version:

Version/Channel Information:

  • Can you reproduce this issue with the current release?
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
  • Does the issue resolve itself when disabling Brave Rewards?
  • Is the issue reproducible on the latest version of Chrome?

Miscellaneous Information:

@stephendonner
Copy link

stephendonner commented Jan 31, 2024

Cross-reference: #35158 (where it currently looks like it doesn't work, necessitating this issue - or maybe they're separate/nuanced issues?)

@evq
Copy link
Member Author

evq commented Feb 2, 2024

I'm going to reopen this as there are actually two cases and so far we've only solved the first one:

  1. user is in active credentials state and request id reuse has not yet occurred ( my existing PR fixes )
  2. user is in generated credentials state and request id reuse has already occurred ( user is forced to go through sign in )

After consulting with @husobee, we've decided that we will have the server return HTTP status 409 Conflict in the request id conflict case and modify the SDK to automatically regenerate the request id when this status code is returned.

@evq evq reopened this Feb 2, 2024
@mattmcalister mattmcalister added the priority/P2 A bad problem. We might uplift this to the next planned release. label Feb 6, 2024
@kjozwiak
Copy link
Member

kjozwiak commented Feb 7, 2024

The above requires 1.62.162 or higher for 1.62.x verification 👍

@LaurenWags
Copy link
Member

Added release-notes/exclude label per discussion with @kjozwiak @rebron

@MadhaviSeelam MadhaviSeelam added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Feb 7, 2024
@MadhaviSeelam
Copy link

MadhaviSeelam commented Feb 7, 2024

Verification PASSED using

Brave | 1.62.162 Chromium: 121.0.6167.164 (Official Build) (64-bit)
-- | --
Revision | c18c9cc62d2b4376a5ada5b98b673dfc7994f20d
OS | Windows 11 Version 23H2 (Build 22631.3085)

Steps:

  1. installed 1.64.21
  2. launched Brave using --env-leo=staging --env-ai-chat.bsg-dev --env-ai-chat-premium.bsg.dev
  3. purchased Leo Premium via account.bravesoftware.com, using leo35742brave2@mailinator.com
  4. tested Premium credentials, ensuring they worked
  5. quit Brave
  6. opened Local State in my profile folder, using Notepad
  7. edited the three (3) valid_from - valid_to timestamp values, subtracting 4 (days) from each
  8. noted our 1st request_id of 2c455d35-bdec-496a-a5aa-d8e032f725cb
  9. quit Brave
  10. installed 1.62.162
  11. relaunched Brave using --env-leo=staging --env-ai-chat.bsg-dev --env-ai-chat-premium.bsg.dev
  12. confirmed working Leo Premium access
  13. also confirmed core issue: Your Brave account session has expired... messaging with Retry button
  14. opened brave://skus-internals
  15. noted our 2nd request_id of b0ef9d10-3e8c-4394-bba5-c7c1980a79dc
  16. quit Brave
  17. launched Brave (same commandline)
  18. reopened brave://skus-internals
  19. confirmed request_id matches that from step 15, b0ef9d10-3e8c-4394-bba5-c7c1980a79dc
  20. quit Brave
  21. overwrote the request_id in Local State with the original request_id recorded in step 9
  22. (@evq did their magic, modifying the staging backend db, changing credential dates to the past)
  23. relaunched Brave using original commandline args
  24. confirmed Leo Premium badging
  25. also confirmed core issue: Your Brave account session has expired... messaging with Retry button
  26. opened brave://skus-internals and noted our 3rd request_id of 530d490b-c4af-47d7-916e-ff963e2abca7
  27. waited ~27 seconds until the above-mentioned session-expired message automatically disappeared

Confirmed background auto-renewed credentials obviated/removed the session-expired message

example example example example example example example example example example
image image image image image image image image image image

@MadhaviSeelam MadhaviSeelam added QA Pass-Win64 and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature/SKUs OS/Android Fixes related to Android browser functionality OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass-Win64 QA/Yes release-notes/exclude
Projects
None yet
7 participants