mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix(coderd/x/chatd): checkpoint buffered message_parts to avoid stale replay (#25145)
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -853,8 +852,9 @@ func buildRelayURL(address string, chatID uuid.UUID) (string, error) {
|
||||
u.Path = fmt.Sprintf("/api/experimental/chats/%s/stream", chatID)
|
||||
q := u.Query()
|
||||
// Relays only need live message_part events, not the full
|
||||
// history; pass after_id=MaxInt64 so the peer skips its snapshot.
|
||||
q.Set("after_id", strconv.FormatInt(math.MaxInt64, 10))
|
||||
// history; pass the relay sentinel so the peer skips its
|
||||
// durable DB snapshot and delivers in-flight parts only.
|
||||
q.Set("after_id", strconv.FormatInt(osschatd.RelaySentinelAfterID, 10))
|
||||
u.RawQuery = q.Encode()
|
||||
return u.String(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user