Client message sync #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Clients should be kept up to date with the messages file.
If a client is online when the message file is updated the solution is trivial, just send the diff to the client, if a client is not online at the time of update we have to wait for the client to be online to send those updates.
How should we handle offline clients? Should we queue the updates in a file for each user's client? This seems like the most reasonable solution to me but i doubt that it's the most efficient.
The solution needs to account for users having multiple clients that may go out of sync with each other ofc.
As the files on the server are the 'master' and should be correct and up to date at all times, would it not be easiest to have the client send an initial sync request when it first launches? It could send the request with the time-stamp of the most recent message and the server could return all messages marked after that stamp
How would we handle deleted messages? If we simply remove the message from the file completely the server will have no knowledge of that message ever existing so it will not be able to tell the client to delete it too (and this might mess up file diffs too)
We could just have the client fully re-fetch all files on each launch? they will simply be text so wont be too large, and it will only happen one time per client launch, so not the end of the world if it takes a little longer than a standard message to send
It feels a bit yuck-y but ig it is a solution.
The spec should be updated to include this, i cant do it rn, if u cant either i can do it in 2 or 3 hours.
The other way it could be done would be for the server to keep an 'event history' with all the patches and their relevant time stamps, and the client could keep track of its last received event and request all subsequent events to prevent refetching the file. This could be additionally configured by an admin to remove patches after a certain amount of time?
@ceres-sees-all wrote in #1 (comment):
Are you sure about that?