From 366cf78626f86a4b0225fedba733f4b995d2c8a9 Mon Sep 17 00:00:00 2001 From: Tak Wai Wong Date: Wed, 14 Sep 2022 14:25:03 -0700 Subject: [PATCH] Fix for issue #2718. --- appservice/consumers/roomserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appservice/consumers/roomserver.go b/appservice/consumers/roomserver.go index 175138141..381440f0f 100644 --- a/appservice/consumers/roomserver.go +++ b/appservice/consumers/roomserver.go @@ -176,11 +176,11 @@ func (s *OutputRoomEventConsumer) sendEvents( // If the number of items in the array is different, // then this should be treated as a different transaction. Incorporate the length // of events into the transaction ID. - txnID := events[0].Event.OriginServerTS().Time().Nanosecond() + len(transaction) + txnID := fmt.Sprintf("%d_%d", events[0].Event.OriginServerTS(), len(transaction)) // Send the transaction to the appservice. // https://matrix.org/docs/spec/application_service/r0.1.2#put-matrix-app-v1-transactions-txnid - address := fmt.Sprintf("%s/transactions/%d?access_token=%s", state.URL, txnID, url.QueryEscape(state.HSToken)) + address := fmt.Sprintf("%s/transactions/%s?access_token=%s", state.URL, txnID, url.QueryEscape(state.HSToken)) req, err := http.NewRequestWithContext(ctx, "PUT", address, bytes.NewBuffer(transaction)) if err != nil { return err