mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 11:23:11 -06:00
Fully populate eventIDMap
This commit is contained in:
parent
0a3db9e952
commit
adf2726f20
|
|
@ -695,17 +695,25 @@ func (v StateResolution) resolveConflictsV2(
|
|||
notConflicted, conflicted []types.StateEntry,
|
||||
) ([]types.StateEntry, error) {
|
||||
|
||||
// Load the non-conflicted events
|
||||
nonConflictedEvents, _, err := v.loadStateEvents(ctx, notConflicted)
|
||||
var eventIDMap map[string]StateEntry
|
||||
|
||||
// Load the conflicted events
|
||||
conflictedEvents, conflictedEventMap, err := v.loadStateEvents(ctx, conflicted)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for k, v := range conflictedEventMap {
|
||||
eventIDMap[k] = v
|
||||
}
|
||||
|
||||
// Load the conflicted events
|
||||
conflictedEvents, eventIDMap, err := v.loadStateEvents(ctx, conflicted)
|
||||
// Load the non-conflicted events
|
||||
nonConflictedEvents, nonConflictedEventMap, err := v.loadStateEvents(ctx, notConflicted)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for k, v := range nonConflictedEventMap {
|
||||
eventIDMap[k] = v
|
||||
}
|
||||
|
||||
// For each conflicted event, we will add a new set of auth events. Auth
|
||||
// events may be duplicated across these sets but that's OK.
|
||||
|
|
|
|||
Loading…
Reference in a new issue