Which actions should be replayed? I guess only those are modyfying data on backend like:
- POST
- PUT
- DELETE
When request failed we should save it somewhere in store, I think store should look like this
{
replays: {
id: {
{
method: 'POST',
body: { name: 5 },
headers: {}
}
}
....
}
}
There will be always only one action per object, let's look at examples: Offline: Create -> Update -> Online
- Create failed
- Save it into replay
- Update failed
- Only body of action should be replaced
- Single create action will be dispatched
Offline: Create-> Delete
- Create failed
- Delete failed
- Online
- No actions should be dispatched
Offline: Update->Delete Same as above
So idea is just push actual state, not all the actions, and keep in store only latest merged action. Also replays queue should always go first, before any request

Would it be good to structure
replaysin the same shape asdata, i.e. arranged byrootthentypethen object ID?๐ store is used by app and should reflect the app's understanding of the state.
๐ this is a really good idea - then we know replies will sync ASAP when people are online.