aboutsummaryrefslogtreecommitdiff
path: root/clientapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-07-05 17:13:26 +0100
committerGitHub <noreply@github.com>2022-07-05 17:13:26 +0100
commit460dccf93d5eb77db00620f0ef5a4f1a91bbe7ae (patch)
tree0b20aa9974d5572aae3ec89e125bb8ef0031cb62 /clientapi
parentc0f824d4375493127799eb3c3ecf0327838813d6 (diff)
Hopefully fix read receipts timestamps (#2557)
This should avoid coercions between signed and unsigned ints which might fix problems like `sql: converting argument $5 type: uint64 values with high bit set are not supported`.
Diffstat (limited to 'clientapi')
-rw-r--r--clientapi/producers/syncapi.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/clientapi/producers/syncapi.go b/clientapi/producers/syncapi.go
index 48b1ae88..0ac63779 100644
--- a/clientapi/producers/syncapi.go
+++ b/clientapi/producers/syncapi.go
@@ -17,6 +17,7 @@ package producers
import (
"context"
"encoding/json"
+ "fmt"
"strconv"
"time"
@@ -83,7 +84,7 @@ func (p *SyncAPIProducer) SendReceipt(
m.Header.Set(jetstream.RoomID, roomID)
m.Header.Set(jetstream.EventID, eventID)
m.Header.Set("type", receiptType)
- m.Header.Set("timestamp", strconv.Itoa(int(timestamp)))
+ m.Header.Set("timestamp", fmt.Sprintf("%d", timestamp))
log.WithFields(log.Fields{}).Tracef("Producing to topic '%s'", p.TopicReceiptEvent)
_, err := p.JetStream.PublishMsg(m, nats.Context(ctx))