impress/app
Emi Matchu 258b360ff2 Oops, fix infinite autosaving loop!
A bit of a hack, because the thing triggering it was also a bit of a
hack? I feel like there's something we gotta do with refactoring how
our multiple concepts of state are managed… but in any case! This seems
to keep basic outfit-loading working, while no longer getting us
trapped in autosave loops!

Here's how I reproduced the bug:
1. Open a saved outfit.
2. Set the browser devtools to apply a latency of 5sec to all requests.
3. Add an item to the outfit, and wait for the autosave to start.
4. While it still says "Saving", remove the item again.
5. Watch how, when the first autosave request comes in, the item is
   re-applied to the outfit, then autosave gets stuck looping forever.

The issue was that, when an outfit finishes saving, the change in
outfit data was triggering this effect in `useOutfitState` that was
*meant* to *initialize* local state from the saved outfit, not to keep
them in sync all the time. (In general, when saved outfit data comes
back from the server, we don't want to use it to "fix" local outfit
state in the case of discrepancies, because the most common source of
discrepancy will be the user having made further changes!)

But anyway, one thing I didn't realize is that we *were* depending on
this hacky hook to do more than I thought: it was responsible for
syncing `id` and `appearanceId` to the local state after saving the
outfit. So, I replaced the `rename` action dispatch here with a new
action that explicitly sets all fields the server is responsible for!
2024-02-25 10:37:08 -08:00
..
assets Oops, fix regression of editor features on item lists page 2024-02-22 15:52:40 -08:00
controllers Read known_glitches when loading alt styles SWF assets 2024-02-24 16:31:05 -08:00
helpers Refactor Impress 2020 config 2024-02-22 13:07:43 -08:00
javascript Oops, fix infinite autosaving loop! 2024-02-25 10:37:08 -08:00
mailers/fundraising Move most fundraising files into a Fundraising module 2024-02-18 20:12:14 -08:00
models Remove SwfAsset#html5_*_url in favor of SwfAsset#urls 2024-02-24 16:29:47 -08:00
services Preload many manifests concurrently for the Alt Styles page 2024-02-23 13:45:12 -08:00
views High-level caching for closet lists 2024-02-20 18:43:39 -08:00