mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-18 12:23:09 -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,
|
notConflicted, conflicted []types.StateEntry,
|
||||||
) ([]types.StateEntry, error) {
|
) ([]types.StateEntry, error) {
|
||||||
|
|
||||||
// Load the non-conflicted events
|
var eventIDMap map[string]StateEntry
|
||||||
nonConflictedEvents, _, err := v.loadStateEvents(ctx, notConflicted)
|
|
||||||
|
// Load the conflicted events
|
||||||
|
conflictedEvents, conflictedEventMap, err := v.loadStateEvents(ctx, conflicted)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
for k, v := range conflictedEventMap {
|
||||||
|
eventIDMap[k] = v
|
||||||
|
}
|
||||||
|
|
||||||
// Load the conflicted events
|
// Load the non-conflicted events
|
||||||
conflictedEvents, eventIDMap, err := v.loadStateEvents(ctx, conflicted)
|
nonConflictedEvents, nonConflictedEventMap, err := v.loadStateEvents(ctx, notConflicted)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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
|
// 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.
|
// events may be duplicated across these sets but that's OK.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue