bugfix: Fix a bug which caused prev_content not to be sent to clients
I don't know how this ever passed QA... also fix a missing rows.Close()
MODIFY
go.sum
go.sum
@@ -497,6 +497,7 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190909003024-a7b16738d86b h1:XfVGCX+0T4WOStkaOsJRllbsiImhB2jgVBGc9L0lPGc=
golang.org/x/net v0.0.0-20190909003024-a7b16738d86b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

MODIFY
syncapi/consumers/roomserver.go
syncapi/consumers/roomserver.go
@@ -253,7 +253,7 @@ func (s *OutputRoomEventConsumer) updateStateEvent(event gomatrixserverlib.Event
}
prevEvent, err := s.db.GetStateEvent(
- context.TODO(), event.Type(), event.RoomID(), stateKey,
+ context.TODO(), event.RoomID(), event.Type(), stateKey,
)
if err != nil {
return event, err

MODIFY
syncapi/storage/sqlite3/output_room_events_table.go
syncapi/storage/sqlite3/output_room_events_table.go
@@ -160,6 +160,7 @@ func (s *outputRoomEventsStatements) selectStateInRange(
if err != nil {
return nil, nil, err
}
+ defer rows.Close() // nolint: errcheck
// Fetch all the state change events for all rooms between the two positions then loop each event and:
// - Keep a cache of the event by ID (99% of state change events are for the event itself)
// - For each room ID, build up an array of event IDs which represents cumulative adds/removes

bugfix: Fix a bug which caused prev_content not to be sent to clients (#919)

I don't know how this ever passed QA... also fix a missing rows.Close()