Commit Graph

13 Commits

Author SHA1 Message Date
projectmoon a65084e04a Unit test for updating room info data.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2020-11-29 21:33:46 +00:00
projectmoon 979dc8ea34 Clearer test name for clearing room info. 2020-11-29 21:29:35 +00:00
projectmoon 0b2246cbd5 Unit tests for inserting and loading room info from db. 2020-11-29 21:29:13 +00:00
projectmoon c8c38ac1d4 Avoid nested map when retrieving room info from db.
continuous-integration/drone/push Build is passing Details
2020-11-29 16:55:23 +00:00
projectmoon 224f8cd0f1 Functions for storing RoomInfo in db. Refactor bot joins room event.
continuous-integration/drone/push Build is passing Details
Add get/insert functions for RoomInfo in the rooms db.

Move 'bot joins room' code to single method, so we can also record a
RoomInfo struct into the database.
2020-11-29 14:00:05 +00:00
projectmoon 0e04e67f6e Log debug instead of trace for timestamp index inserts.
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2020-11-10 20:37:14 +00:00
projectmoon 551f21a49a Fix minor typo in rooms db code. 2020-11-10 20:22:26 +00:00
projectmoon 9ed2a81dd3 Record all users in room when joining.
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2020-11-10 20:18:00 +00:00
projectmoon 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.
2020-11-09 21:16:07 +00:00
projectmoon d7aaed9e00 Implement room clearing, log to info for member updates. 2020-11-08 21:47:01 +00:00
projectmoon b5c78bcee5 Remove userandroom struct from rooms db 2020-11-08 21:47:01 +00:00
projectmoon 51ba3e3f42 Record user join/leaves in rooms. Move event emitter to its own file. 2020-11-08 21:47:01 +00:00
projectmoon 8e2f34819e Half implemented room state management foundations. 2020-11-08 21:47:01 +00:00