Room State Management #44

Manually merged
projectmoon merged 11 commits from room-state-management into master 2020-11-10 20:58:50 +00:00
Owner

Design Document: https://git.agnos.is/projectmoon/matrix-dicebot/wiki/Feature%3A-Room-State-Management

Issue: projectmoon/matrix-dicebot#20

When the design document is fulfilled and all issues checked off, then this can be merged.

Design Document: https://git.agnos.is/projectmoon/matrix-dicebot/wiki/Feature%3A-Room-State-Management Issue: https://git.agnos.is/projectmoon/matrix-dicebot/issues/20 When the design document is fulfilled and all issues checked off, then this can be merged.
projectmoon added 8 commits 2020-11-09 21:25:24 +00:00
fb24090952 Keep seen events in database, don't process already-seen events.
Adds a new function `should_process` to rooms impl that determines if
calling could should proceed with processing an event ID. Event IDs
are recorded (along with room ID) as a key pointing to the
system-local timestamp of when the event was received. If the key was
not originally present, we instruct calling code to process the event.

Events are also asychronously recorded by timestamp using a sled event
watcher that listens to inserts in the main tree (described above).
This secondary tree will allow easy cleanup of old events in the
future.
9349dd5f00 Add event processing check to received messages.
Also rename the existing `should_process` function to be more clear,
given presence of another similarly named function:
should_process_message.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
0939feee84
Placeholder to record all user info when joining room
projectmoon changed title from Room State Management to WIP:Room State Management 2020-11-09 21:25:34 +00:00
Author
Owner

As of this writing, there are two missing pieces of functionality before merging:

  • Adding all users in the room to the database upon joining a room.
  • Recording room-level information (ID, name, etc) when joining a room.
As of this writing, there are two missing pieces of functionality before merging: * Adding all users in the room to the database upon joining a room. * Recording room-level information (ID, name, etc) when joining a room.
projectmoon reviewed 2020-11-09 21:50:22 +00:00
@ -0,0 +61,4 @@
/// HashSets as its values. Atomicity is partially handled. If the
/// Tree is a transactional tree, operations will be atomic.
/// Otherwise, there is a potential non-atomic step.
mod hashset_tree {
Author
Owner

Perhaps move this and TxableTree into a common part of the database code. Maybe also convert it to a trait. The atomicity issues with Tree instances also should be addressed. Use fetch_and_update when it's a regular Tree, and the existing code if it's a TransactionalTree (since the atomicity is controlled by the transaction).

Perhaps move this and `TxableTree` into a common part of the database code. Maybe also convert it to a trait. The atomicity issues with `Tree` instances also should be addressed. Use `fetch_and_update` when it's a regular Tree, and the existing code if it's a `TransactionalTree` (since the atomicity is controlled by the transaction).
Author
Owner

Deferring to a future changeset.

Deferring to a future changeset.
projectmoon marked this conversation as resolved
src/db/rooms.rs Outdated
@ -0,0 +115,4 @@
}
/// Functions that specifically relate to the "timestamp index" tree,
/// which is stored on the Room sinstance as a tree called
Author
Owner

Typo: sintance.

Typo: `sintance`.
projectmoon marked this conversation as resolved
projectmoon added 1 commit 2020-11-10 20:18:13 +00:00
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
9ed2a81dd3
Record all users in room when joining.
projectmoon changed title from WIP:Room State Management to Room State Management 2020-11-10 20:21:48 +00:00
Author
Owner

Deferring the atomicity changes and recording of room info to future pull requests.

Deferring the atomicity changes and recording of room info to future pull requests.
projectmoon added 2 commits 2020-11-10 20:35:35 +00:00
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/push Build was killed Details
af197dd58f
Log debug instead of trace for timestamp index inserts.
projectmoon force-pushed room-state-management from af197dd58f to 0e04e67f6e 2020-11-10 20:37:27 +00:00 Compare
projectmoon manually merged commit 0e04e67f6e into master 2020-11-10 20:58:50 +00:00
projectmoon deleted branch room-state-management 2020-11-10 20:59:56 +00:00
Sign in to join this conversation.
No description provided.