aboutsummaryrefslogtreecommitdiff
path: root/syncapi
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-06-02 15:48:04 +0200
committerGitHub <noreply@github.com>2023-06-02 15:48:04 +0200
commitd11da6ec7cc683864e1e10b7f47764d1bb0c4f1a (patch)
treec052ca6bb1f812d4cf91609e067f2736f969e0a3 /syncapi
parentea6b368ad424a3d2e05135afb7fd0c0801b3609b (diff)
Fix newly found linter issues (#3099)
Fixes the issues found in https://github.com/matrix-org/dendrite/actions/runs/5155539352/jobs/9285342056#step:5:22. Only naked returns in longer functions.
Diffstat (limited to 'syncapi')
-rw-r--r--syncapi/routing/messages.go7
-rw-r--r--syncapi/streams/stream_pdu.go4
2 files changed, 6 insertions, 5 deletions
diff --git a/syncapi/routing/messages.go b/syncapi/routing/messages.go
index 58f663d0..aeaec699 100644
--- a/syncapi/routing/messages.go
+++ b/syncapi/routing/messages.go
@@ -314,11 +314,12 @@ func (r *messagesReq) retrieveEvents() (
clientEvents []synctypes.ClientEvent, start,
end types.TopologyToken, err error,
) {
+ emptyToken := types.TopologyToken{}
// Retrieve the events from the local database.
streamEvents, err := r.snapshot.GetEventsInTopologicalRange(r.ctx, r.from, r.to, r.roomID, r.filter, r.backwardOrdering)
if err != nil {
err = fmt.Errorf("GetEventsInRange: %w", err)
- return
+ return []synctypes.ClientEvent{}, emptyToken, emptyToken, err
}
var events []*rstypes.HeaderedEvent
@@ -333,11 +334,11 @@ func (r *messagesReq) retrieveEvents() (
// on the ordering), or we've reached a backward extremity.
if len(streamEvents) == 0 {
if events, err = r.handleEmptyEventsSlice(); err != nil {
- return
+ return []synctypes.ClientEvent{}, emptyToken, emptyToken, err
}
} else {
if events, err = r.handleNonEmptyEventsSlice(streamEvents); err != nil {
- return
+ return []synctypes.ClientEvent{}, emptyToken, emptyToken, err
}
}
diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go
index b5fd5be8..0ea48a9d 100644
--- a/syncapi/streams/stream_pdu.go
+++ b/syncapi/streams/stream_pdu.go
@@ -489,7 +489,7 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
stateEvents, err := snapshot.CurrentState(ctx, roomID, stateFilter, excludingEventIDs)
if err != nil {
- return
+ return jr, err
}
jr.Summary, err = snapshot.GetRoomSummary(ctx, roomID, device.UserID)
@@ -542,7 +542,7 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
}
backwardTopologyPos, backwardStreamPos, err = snapshot.PositionInTopology(ctx, event.EventID())
if err != nil {
- return
+ return jr, err
}
prevBatch = &types.TopologyToken{
Depth: backwardTopologyPos,