mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-30 21:12:45 +00:00
Associate transactions with session IDs instead of device IDs (#789)
This commit is contained in:
parent
5eb63f1d1e
commit
43308d2f3f
9 changed files with 55 additions and 39 deletions
|
@ -32,7 +32,7 @@ type RoomEventDatabase interface {
|
|||
StoreEvent(
|
||||
ctx context.Context,
|
||||
event gomatrixserverlib.Event,
|
||||
txnAndDeviceID *api.TransactionID,
|
||||
txnAndSessionID *api.TransactionID,
|
||||
authEventNIDs []types.EventNID,
|
||||
) (types.RoomNID, types.StateAtEvent, error)
|
||||
// Look up the state entries for a list of string event IDs
|
||||
|
@ -67,7 +67,7 @@ type RoomEventDatabase interface {
|
|||
// Returns an empty string if no such event exists.
|
||||
GetTransactionEventID(
|
||||
ctx context.Context, transactionID string,
|
||||
deviceID string, userID string,
|
||||
sessionID int64, userID string,
|
||||
) (string, error)
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ func processRoomEvent(
|
|||
if input.TransactionID != nil {
|
||||
tdID := input.TransactionID
|
||||
eventID, err = db.GetTransactionEventID(
|
||||
ctx, tdID.TransactionID, tdID.DeviceID, input.Event.Sender(),
|
||||
ctx, tdID.TransactionID, tdID.SessionID, input.Event.Sender(),
|
||||
)
|
||||
// On error OR event with the transaction already processed/processesing
|
||||
if err != nil || eventID != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue