mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Get missing event tweaks (#1514)
* Adjust backfill to send backward extremity with state before other backfilled events, include prev_events with no state amongst missing events * Not finished refactor * Fix test * Remove isInboundTxn * Remove debug logging
This commit is contained in:
parent
0804594a61
commit
8001627cfc
3 changed files with 81 additions and 28 deletions
|
@ -516,6 +516,23 @@ func TestTransactionFetchMissingPrevEvents(t *testing.T) {
|
|||
|
||||
var rsAPI *testRoomserverAPI // ref here so we can refer to inputRoomEvents inside these functions
|
||||
rsAPI = &testRoomserverAPI{
|
||||
queryEventsByID: func(req *api.QueryEventsByIDRequest) api.QueryEventsByIDResponse {
|
||||
res := api.QueryEventsByIDResponse{}
|
||||
for _, ev := range testEvents {
|
||||
for _, id := range req.EventIDs {
|
||||
if ev.EventID() == id {
|
||||
res.Events = append(res.Events, ev)
|
||||
}
|
||||
}
|
||||
}
|
||||
return res
|
||||
},
|
||||
queryStateAfterEvents: func(req *api.QueryStateAfterEventsRequest) api.QueryStateAfterEventsResponse {
|
||||
return api.QueryStateAfterEventsResponse{
|
||||
PrevEventsExist: true,
|
||||
StateEvents: testEvents[:5],
|
||||
}
|
||||
},
|
||||
queryMissingAuthPrevEvents: func(req *api.QueryMissingAuthPrevEventsRequest) api.QueryMissingAuthPrevEventsResponse {
|
||||
missingPrevEvent := []string{"missing_prev_event"}
|
||||
if len(req.PrevEventIDs) == 1 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue