Stoobly / stoobly-agent

Record, mock, and test HTTP/HTTPS requests. CLI agent for Stoobly.
Other
6 stars 0 forks source link

Enhance Snapshot Versioning #173

Closed Jvlythical closed 7 months ago

Jvlythical commented 7 months ago

Update .stoobly/snapshots/VERSION to include a delimitted list of event uuids. Under the current implementation, we only have access to the latest proccessed event uuid. This works fine when working in an isolated environment. However when merging logs from team members, whoever made the last snapshot will be unable to apply snapshots outside their branch. The existing fix is to set their VERSION to an older version.

For example, given the following:

User A has VERSION = 3 with the following log: 1 2 3

User B has VERSION = 4 with the following log: 1 2 4

Merged log: 1 2 3 4

However, when User B tries to apply the snapshots, nothing will be applied since their VERSION = 4 (the latest version). Under the new implementation, VERSION will contain all the uuids proccessed from log. When snapshots are applied, we will now check when the two list of uuids diverge. For example:

User B has VERSION: 1 2 4

Merged log: 1 2 3 4

Divergence is at uuid 3, we will begin proccessing at uuid 3. Since uuid 4 has already processed, we will skip processing that event.