mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
* bugfix: Fix #908 by setting the correct state after the event Previously, this would only happen if the state already existed previously! * Structured logging
This commit is contained in:
parent
acb505b717
commit
9f74a8798e
2 changed files with 6 additions and 0 deletions
|
@ -116,6 +116,7 @@ func (t *txnReq) processTransaction() (*gomatrixserverlib.RespSend, error) {
|
|||
results[e.EventID()] = gomatrixserverlib.PDUResult{
|
||||
Error: err.Error(),
|
||||
}
|
||||
util.GetLogger(t.context).WithError(err).WithField("event_id", e.EventID()).Warn("Failed to process incoming federation event, skipping it.")
|
||||
} else {
|
||||
results[e.EventID()] = gomatrixserverlib.PDUResult{}
|
||||
}
|
||||
|
|
|
@ -366,11 +366,16 @@ func (v StateResolutionV1) loadStateAfterEventsForNumericTuples(
|
|||
// update that key in the result.
|
||||
// If the requested event wasn't a state event then the state after
|
||||
// it is the same as the state before it.
|
||||
set := false
|
||||
for i := range result {
|
||||
if result[i].StateKeyTuple == prevState.StateKeyTuple {
|
||||
result[i] = prevState.StateEntry
|
||||
set = true
|
||||
}
|
||||
}
|
||||
if !set { // no previous state exists for this event: add new state
|
||||
result = append(result, prevState.StateEntry)
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue