aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/input_events.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-07-21 15:48:21 +0100
committerGitHub <noreply@github.com>2020-07-21 15:48:21 +0100
commitb6bc132485ec4d6b37815929f6a4e73e5a062d3b (patch)
treedddea5f8e9fdbd25905822971a908218eb6697a6 /roomserver/internal/input_events.go
parent1d72ce8b7ab759555503df37af666529749b489c (diff)
Use TransactionWriter in other component SQLite (#1209)
* Use TransactionWriter on other component SQLites * Fix sync API tests * Fix panic in media API * Fix a couple of transactions * Fix wrong query, add some logging output * Add debug logging into StoreEvent * Adjust InsertRoomNID * Update logging
Diffstat (limited to 'roomserver/internal/input_events.go')
-rw-r--r--roomserver/internal/input_events.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/roomserver/internal/input_events.go b/roomserver/internal/input_events.go
index 04538cf6..a6308299 100644
--- a/roomserver/internal/input_events.go
+++ b/roomserver/internal/input_events.go
@@ -18,6 +18,7 @@ package internal
import (
"context"
+ "fmt"
"github.com/matrix-org/dendrite/internal/eventutil"
"github.com/matrix-org/dendrite/roomserver/api"
@@ -65,13 +66,13 @@ func (r *RoomserverInternalAPI) processRoomEvent(
// Store the event.
roomNID, stateAtEvent, redactionEvent, redactedEventID, err := r.DB.StoreEvent(ctx, event, input.TransactionID, authEventNIDs)
if err != nil {
- return
+ return "", fmt.Errorf("r.DB.StoreEvent: %w", err)
}
// if storing this event results in it being redacted then do so.
if redactedEventID == event.EventID() {
r, rerr := eventutil.RedactEvent(redactionEvent, &event)
if rerr != nil {
- return "", rerr
+ return "", fmt.Errorf("eventutil.RedactEvent: %w", rerr)
}
event = *r
}
@@ -93,7 +94,7 @@ func (r *RoomserverInternalAPI) processRoomEvent(
// Lets calculate one.
err = r.calculateAndSetState(ctx, input, roomNID, &stateAtEvent, event)
if err != nil {
- return
+ return "", fmt.Errorf("r.calculateAndSetState: %w", err)
}
}
@@ -105,7 +106,7 @@ func (r *RoomserverInternalAPI) processRoomEvent(
input.SendAsServer, // send as server
input.TransactionID, // transaction ID
); err != nil {
- return
+ return "", fmt.Errorf("r.updateLatestEvents: %w", err)
}
// processing this event resulted in an event (which may not be the one we're processing)
@@ -123,7 +124,7 @@ func (r *RoomserverInternalAPI) processRoomEvent(
},
})
if err != nil {
- return
+ return "", fmt.Errorf("r.WriteOutputEvents: %w", err)
}
}