]> git.cworth.org Git - zombocom-ai/commitdiff
Add a new 'reset' event from server to client before replay
authorCarl Worth <cworth@cworth.org>
Thu, 8 Dec 2022 06:28:19 +0000 (22:28 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 8 Dec 2022 06:28:19 +0000 (22:28 -0800)
This handles the case of a client that persists across a server
restart, (or various other disconnect/reconnect scenarios).

Prior to this commit, the client could end up with multiple copies of
images through the following sequence:

1. A client is chugging along with the server and has a set of images

2. The server is stopped and restarted

3. When the server comes up again it sees the client connect and so it
   replays all images

Boom. The client now has multiple copies of any image it already had.

To fix this, the server now sends a 'reset' event prior to sending any
replay of images. When the client gets this, it clears out all images
it has.


No differences found