I have a similar problem, with a mobile app. I don’t build the web version…
but its built as if always connected.
all data updates go thru a queue store and the data is backed by persistent storage
next time it starts, it loads the queue, from persistent storage, and starts a worker task, that checks if there is anything on the queue, if on the queue it attempts to send, and if successful, removes that entry from storage and the queue. it repeats trying to send every minute while running
we added a timestamp value on each record when it enters the queue,
so later we can examine how LONG is was from create to upload.