department-of-veterans-affairs / va-mobile-app

"If VA were a company, it would have a flagship mobile app."
https://department-of-veterans-affairs.github.io/va-mobile-app/
13 stars 2 forks source link

BUG - sev-3 - All - Calling the mobile/v0/push/register API at least three times #7954

Open TKDickson opened 7 months ago

TKDickson commented 7 months ago

What happened?

When we call the /mobile/v0/push/register API from the app (which happens during the sign-in sequence for Android, or after opt-in for iOS), we nearly always call it..... three times simultaneously.

image.png

Once - just once, like a unicorn vanishing into the mist - I saw it log five times during the login sequence on Android.

Specs:

Steps to Reproduce

Desired behavior

Should just call it once.

Acceptance Criteria

Bug Severity - BE SURE TO ADD THE SEVERITY LABEL

See [Bug Tracking](https://department-of-veterans-affairs.github.io/va-mobile-app/docs/QA#issue-severity) for details on severity levels

Linked to Story

Screen shot(s) and additional information

Full JSON response for services related to issue (expand/collapse)

Ticket Checklist

Sparowhawk commented 5 months ago

@TKDickson This likely will be fixed with the React Query Migration for Notifications when that gets merged you should recheck this

TKDickson commented 5 months ago

Added the notification migration ticket as a dependency.

theodur commented 1 month ago

@TKDickson Are you fine with me attaching this ticket to Dylan's RQ Notification PR and marking it as in progress? This should get resolved there with the updated RQ logic

TKDickson commented 1 month ago

@theodur yes definitely

TKDickson commented 3 weeks ago

Have been blocked on this since Tuesday - there's a reverse proxy server somewhere in the staging notification ecosystem that's not playing nicely. Hopefully resolved today.

TKDickson commented 3 weeks ago

DSVA support thread is resolved and I've confirmed I can successfully register for notifications, as well as fetch preferences, from upstream servers. This is unblocked and I can start working on it tomorrow.

TKDickson commented 2 weeks ago

During login, we're still calling the register call twice when opting into push on iOS:

image.png

If you opt-out of push during login, and then later turn it on (via jumping from the notification preferences screen in the app out to settings), then the register call is made...... dear god, 7 times:

image.png

@Sparowhawk still broken

TKDickson commented 3 days ago

This is improved, but not yet fully fixed.

I'm guessing it's some kind of race condition, along the lines of "the call is made once when you reach the page, and then again immediately when the page reloads because you've app-switched back into it" but I could be wrong.

TKDickson commented 3 days ago

This is fully fixed/resolved - won't be able to close until the issue on #8253 is ready, but does not require further testing.