(ctx context.Context, e *gomatrixserverlib.Event)
| 607 | } |
| 608 | |
| 609 | func (t *missingStateReq) isPrevStateKnown(ctx context.Context, e *gomatrixserverlib.Event) bool { |
| 610 | expected := len(e.PrevEventIDs()) |
| 611 | state, err := t.db.StateAtEventIDs(ctx, e.PrevEventIDs()) |
| 612 | if err != nil || len(state) != expected { |
| 613 | // We didn't get as many state snapshots as we expected, or there was an error, |
| 614 | // so we haven't completely solved the problem for the new event. |
| 615 | return false |
| 616 | } |
| 617 | // Check to see if we have a populated state snapshot for all of the prev events. |
| 618 | for _, stateAtEvent := range state { |
| 619 | if stateAtEvent.BeforeStateSnapshotNID == 0 { |
| 620 | // One of the prev events still has unknown state, so we haven't really |
| 621 | // solved the problem. |
| 622 | return false |
| 623 | } |
| 624 | } |
| 625 | return true |
| 626 | } |
| 627 | |
| 628 | func (t *missingStateReq) lookupMissingStateViaState( |
| 629 | ctx context.Context, roomID, eventID string, roomVersion gomatrixserverlib.RoomVersion, |
no test coverage detected