~f4814n/frost

dd5581fb05b3aa1be810685d837e9116379c18ce — Fabian Geiselhart 10 months ago 3f6d7fc
RoomView: Fix request spamming when history is unreadable

As soon as a LogicError is encountered while backfilling we stop trying
to load more history.
1 files changed, 6 insertions(+), 0 deletions(-)

M cmd/frost/room_view.go
M cmd/frost/room_view.go => cmd/frost/room_view.go +6 -0
@@ 1,6 1,7 @@
package main

import (
	"errors"
	"fmt"
	"time"



@@ 65,6 66,11 @@ func (r *RoomView) Start(rx, tx chan Event) {
		for r.history.Next() {
			if r.history.Err != nil {
				r.log.WithField("error", r.history.Err).Warn("Error while traversing history")
				// We probably have insufficient permissions for viewing the history
				// so let's not retry
				if errors.As(r.history.Err, &matrix.LogicError{}) {
					break
				}
				continue
			}