summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraven <citrons@mondecitronne.com>2025-10-22 16:30:21 -0500
committerraven <citrons@mondecitronne.com>2026-02-09 13:14:00 -0600
commit4c359cc8d5c9a230852927b9bfc7ef5c55dd0c63 (patch)
tree6e58cd9e4d018177bb2c0a7b7e4131bb8ec3aada
parent2687da0a33c7de5f6a228ad1e6391d9efaddbbb3 (diff)
fix off by one in message indices
-rw-r--r--server/channel/channel.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/channel/channel.go b/server/channel/channel.go
index 9ec0b41..9984b7b 100644
--- a/server/channel/channel.go
+++ b/server/channel/channel.go
@@ -186,11 +186,11 @@ func (c *Channel) Put(m proto.Object, From *session.Session) proto.Object {
channel, _ := history.CreateBucketIfNotExists([]byte(c.id))
ids, _ := channel.CreateBucketIfNotExists([]byte("ids"))
- index, err := channel.NextSequence()
+ key := []byte(strconv.Itoa(int(channel.Sequence())))
+ _, err := channel.NextSequence()
if err != nil {
return err
}
- key := []byte(strconv.Itoa(int(index)))
var buf bytes.Buffer
writer := bufio.NewWriter(&buf)