Page MenuHomePhabricator

[Cashtab] Have refreshes update version for PWA users on update
ClosedPublic

Authored by bytesofman on Jan 19 2024, 18:04.

Details

Summary

Cashtab has existing logic to push update notifications to users. This has been robust on the webapp but run into some issues with the PWA experience.

Digging into it, it's a complex issue.

Following this documented approach -- add code that helps make sure a refresh actually does pull in the new version.

https://redfin.engineering/how-to-fix-the-refresh-button-when-using-service-workers-a8e27af6df68

Difficult to test this since we need to know how it impacts cashtab.com PWA users. In local testing, it does seem to push out updates reliably.

Test Plan

What I did
npm run build
netlify deploy --prod --dir=build
...pushes this live
then change a component, e.g. the "Send to" form label on the Send screen to "Send to has changed"
npm run build
netlify deploy --prod --dir=build
Refresh page in PWA, see udpate modal. On update, the form label has changed.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
improve-pwa-sw-updates
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26490
Build 52550: Build Diffcashtab-tests
Build 52549: arc lint + arc unit

Event Timeline

emack requested changes to this revision.Jan 20 2024, 10:32
emack added a subscriber: emack.

Refresh page in PWA, see udpate modal. On update, the form label has changed.

Manually refreshing PWA tested all ok, pulling in the latest update. However thinking from an UX pov, most users wouldn't think to manually refresh their PWA if they were unaware that there was an update in the first place. There was a period of time where quite a few users messaged in the tg for help with screenshots without the hamburger icon, which was easy to identify.
Is this where a proper push notification mechanism comes in?

This revision now requires changes to proceed.Jan 20 2024, 10:32

Refresh page in PWA, see udpate modal. On update, the form label has changed.

Manually refreshing PWA tested all ok, pulling in the latest update. However thinking from an UX pov, most users wouldn't think to manually refresh their PWA if they were unaware that there was an update in the first place. There was a period of time where quite a few users messaged in the tg for help with screenshots without the hamburger icon, which was easy to identify.
Is this where a proper push notification mechanism comes in?

We already show users a modal that updates - the issue is that the app is sometimes not realizing an update is available and not showing the modal.

This could be further optimized. For now, though, I want to make sure the problem of PWA users being stuck on an old version is solved. At the moment, the only consistent solutions are

  • wait for variable amount of time until PWA does finally update itself (seems to depend on browser/device, user cache settings)
  • delete cookies, which works every time but also deletes wallets

These options are unacceptable.

Is this where a proper push notification mechanism comes in?

Not really -- check out the article in the diff description. PWAs have some of their own intricacies, but it is distinct from browser push notifications. These would allow for features like incoming tx notifications when the user is not actively browsing the app.

This revision is now accepted and ready to land.Jan 20 2024, 14:12