From 5f8ce1191515c10d2e57cb2111ea2c03ae1aead5 Mon Sep 17 00:00:00 2001 From: Tak Wai Wong Date: Wed, 14 Sep 2022 13:56:29 -0700 Subject: [PATCH] fix txnid --- 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 c24603903..175138141 100644 --- a/appservice/consumers/roomserver.go +++ b/appservice/consumers/roomserver.go @@ -174,9 +174,9 @@ func (s *OutputRoomEventConsumer) sendEvents( } // If the number of items in the array is different, - // then this should be a different transaction. Incorporate the length + // then this should be treated as a different transaction. Incorporate the length // of events into the transaction ID. - txnID := events[0].Event.OriginServerTS().Time().Add(time.Duration(len(events))) + txnID := events[0].Event.OriginServerTS().Time().Nanosecond() + len(transaction) // Send the transaction to the appservice. // https://matrix.org/docs/spec/application_service/r0.1.2#put-matrix-app-v1-transactions-txnid