Skip to content

Instantly share code, notes, and snippets.

@meandavejustice
Created September 1, 2015 22:28
Show Gist options
  • Save meandavejustice/90b200128072eb4f80cc to your computer and use it in GitHub Desktop.
Save meandavejustice/90b200128072eb4f80cc to your computer and use it in GitHub Desktop.
- User opens browser window.
- Addon queries server for updates, and attempts to establish socket
connection.
- User is notified of updates via Badge icon.
- User clicks addon icon and is directed to ideatown web client.
- On 'loaded' event, the addon sends down the update data, as well as
currently installed addons.
- The client updates itself based on this data.(The user's browser
should ALWAYS be the source of truth.)
- If there are conflicts, the addon should push an 'update' event to
the server to update the model.
- We allow the user to select which addons they would like to
install/remove and send the data to the addon.
- The addon will install/remove, send progress updates to the client,
and send an 'update' event to the server.
- User navigates away from site.
- Hours later, an update is pushed and the user is notified again via
ideatown icon badge. flow repeats.
+------------------------------------------+
| 2. Send updates. 'handshake' complete. |
+-----------------------+-+ |
| Server | |
+-------------------------+ |
| | 1. 'hello' fetch updates. |
| | <--- Establish Connection. |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | v
+-------------------------+ |
+------+-----------------------+
| Addon |
+------------------------------+
+-------------------------------------> | |
| 5. Send ids of updates/removals | 6. install/remove, send an |
| | update to server. |
| | |
| | |
| | |
| | |
| | |
| +-------------------+----------+
| |
| ^ |
| | |
++----------------------------+ | |
| Client | | |
+-----------------------------+ |3. 'loaded' |
| +--------------+ (if conflict |
| | send updates |
| | to server |
| | from addon) |
| | |
| | |
| | |
| | |
| | <-----------------------------+
| | 4. Response to 'loaded'.
+-----------------------------+ {current: ['id3', 'id4'],
updates: ['id1', 'id2']}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment