Skip to content

Commit

Permalink
Remove dummy state event in history sync
Browse files Browse the repository at this point in the history
It's not needed anymore as the relevant PR was merged, and Synapse 1.53
seems to include a regression which breaks sending non-member state events
(which seems to be fixed by matrix-org/synapse#12083).
  • Loading branch information
tulir committed Feb 28, 2022
1 parent 9730c5e commit a3ba1e3
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions historysync.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,8 @@ func (portal *Portal) backfill(source *User, messages []*waProto.WebMessageInfo)

firstMsgTimestamp := time.Unix(int64(messages[len(messages)-1].GetMessageTimestamp()), 0)

historyBatch.StateEventsAtStart = make([]*event.Event, 1)
newBatch.StateEventsAtStart = make([]*event.Event, 1)

// TODO remove the dummy state events after https://github.com/matrix-org/synapse/pull/11188
emptyStr := ""
dummyStateEvent := event.Event{
Type: BackfillDummyStateEvent,
Sender: portal.MainIntent().UserID,
StateKey: &emptyStr,
Timestamp: firstMsgTimestamp.UnixMilli(),
Content: event.Content{},
}
historyBatch.StateEventsAtStart[0] = &dummyStateEvent
newBatch.StateEventsAtStart[0] = &dummyStateEvent
historyBatch.StateEventsAtStart = make([]*event.Event, 0)
newBatch.StateEventsAtStart = make([]*event.Event, 0)

addedMembers := make(map[id.UserID]*event.MemberEventContent)
addMember := func(puppet *Puppet) {
Expand Down

0 comments on commit a3ba1e3

Please sign in to comment.