From b85e031b2fec432a245b04b023d4db9c9bca411d Mon Sep 17 00:00:00 2001 From: Kegsay Date: Mon, 13 Mar 2017 16:43:06 +0000 Subject: [PATCH] Updated Client Sync Server Design (markdown) --- Client-Sync-Server-Design.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Client-Sync-Server-Design.md b/Client-Sync-Server-Design.md index 49e6839..f97b59c 100644 --- a/Client-Sync-Server-Design.md +++ b/Client-Sync-Server-Design.md @@ -38,20 +38,23 @@ Database: - For each room, get the latest N messages: `SELECT * FROM timeline WHERE room_id=? ORDER BY pkey_id DESC LIMIT N` - "Roll back" the current state by the number of timeline entries and return that along with the `pkey_id` stream token to Alice. -#### Alice hits /sync with a token with no new events +#### Alice hits /sync with a token - Get all rooms Alice is joined to: `SELECT room_id FROM room_state WHERE type="m.room.member" AND state_key="@alice:localhost" AND membership="join";` - Cache this information in-memory. +- We need to know if this token is going to make us do a lot of work. Work out if we are `= M: +Else if number of entries >= M: - Ask the room server: * Which rooms Alice is in. * For each room, get current state and latest N events.