nicholaschiang / hammock

Move your newsletters outside of your inbox. Focus on and learn from the content you love in a distraction-free reading space.
https://readhammock.com
GNU Affero General Public License v3.0
11 stars 1 forks source link

Don't revalidate locally mutated account #27

Closed nicholaschiang closed 3 years ago

nicholaschiang commented 3 years ago

This is a high-priority bug over at tutorbookapp/tutorbook as well:

We don't SWR to automatically revalidate /api/account data that has been locally mutated (e.g. when the user selects subscriptions) but not yet updated server-side (e.g. the user hasn't yet clicked the "Save subscriptions" button).

The current behavior (of SWR revalidating even when local mutations haven't been saved) results in the clearing of subscription selections whenever the user switches tabs (which triggers SWR's automatic revalidation):

https://user-images.githubusercontent.com/20798889/117685573-e9143f00-b16a-11eb-9582-b979e097d432.mov