Fix some edge cases with /sync (#302)
Including: - Handle timeout=0 correctly - Always return immediately on initial sync - Handle spurious wake ups from the notifier
This commit is contained in:
parent
35b628f5bf
commit
bd07447abe
4 changed files with 95 additions and 42 deletions
|
|
@ -258,7 +258,7 @@ func TestNewEventAndWasPreviouslyJoinedToRoom(t *testing.T) {
|
|||
func waitForEvents(n *Notifier, req syncRequest) (types.StreamPosition, error) {
|
||||
done := make(chan types.StreamPosition, 1)
|
||||
go func() {
|
||||
newPos := n.WaitForEvents(req)
|
||||
newPos := n.WaitForEvents(req, req.since)
|
||||
done <- newPos
|
||||
close(done)
|
||||
}()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue