This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Smoke Test
Jim Pick edited this page Jan 9, 2018
·
7 revisions
Really simple test case...
2 users, Alice and Bob
The model we want to sync is a 2x2 pixel canvas.
There are 4 colors: r (Red), g (Green), b (Blue), w (White)
- Alice starts with a blank canvas and is online. Bob is also online, has joined, but hasn't synced yet
Alice Bob
+---+---+ +---+---+
| w | w | | | |
+---+---+ +---+---+
| w | w | | | |
+---+---+ +---+---+
- Alice makes an edit
Alice Bob
+---+---+ +---+---+
| r | w | | | |
+---+---+ +---+---+
| w | w | | | |
+---+---+ +---+---+
2a. Alice's edit gets synced over to Bob's canvas
Alice Bob
+---+---+ +---+---+
| r | w | | r | w |
+---+---+ sync -> +---+---+
| w | w | | w | w |
+---+---+ +---+---+
- Bob makes an edit
Alice Bob
+---+---+ +---+---+
| r | w | | r | w |
+---+---+ +---+---+
| w | w | | w | b |
+---+---+ +---+---+
3a. Bob's edit gets synced to Alice's canvas
Alice Bob
+---+---+ +---+---+
| r | w | | r | w |
+---+---+ <- Sync +---+---+
| w | b | | w | b |
+---+---+ +---+---+
- Alice and/or Bob go offline
Alice Bob
+---+---+ +---+---+
| r | w | | r | w |
+---+---+ -- X -- +---+---+
| w | b | | w | b |
+---+---+ +---+---+
- Both Alice and Bob make edits while offline
Alice Bob
+---+---+ +---+---+
| r | g | | r | g |
+---+---+ -- X -- +---+---+
| w | r | | w | w |
+---+---+ +---+---+
- Alice and Bob both go back online, and re-sync
Alice Bob
+---+---+ +---+---+
| r | g | | r | g |
+---+---+ <-- sync --> +---+---+
| w | * | | w | * |
+---+---+ +---+---+
* = conflict, Alice wanted 'r', Bob wanted 'w'