4 ms·
Whether users see the action locally or not is decided on a per-action basis. For more visual actions like movement, we use a local imposter that gets overwritt
by tyleo 7mo ago
Whether users see the action locally or not is decided on a per-action basis. For more visual actions like movement, we use a local imposter that gets overwritten on completion of the action (success or failure). These revert to the most recent “committed” state which already passed through the action funnel.
We have some actions which happen when saving config UI which don’t really need realtime sync when “save” is pressed and we treat them more like a normal POST request (e.g. we wait for full commit before rerendering). The form fields are kinds a built-in imposter.
For state snapshots we only do big ones. The “full save” that happens every 25 actions or so. These aren’t generally used for reverting people.
So it kinda works like:
1. Do I have an outstanding imposter? If so read from it.
2. Otherwise read from the committed state.
- forrestthewoods 7mo agoAhh that’s interesting. So instead of “rollback and replay” it’s more like “have a committed state and transient preview on top that may or may not commit”. Implementation could vary between “commit the preview” vs “delete preview and create commit”. But that’s just an implementation detail. Anyhow. That’s neat and clever. Thanks!