loop: add notification versioning

This commit is contained in:
Andras Banki-Horvath 2025-10-30 17:56:14 +01:00 committed by sputn1ck
parent 460fc116d8
commit 79af5b3703
No known key found for this signature in database
GPG key ID: 671103D881A5F0E4
3 changed files with 390 additions and 314 deletions

View file

@ -36,6 +36,9 @@ const (
// connection to the server needs to be alive before we consider it a
// successful connection.
defaultMinAliveConnTime = time.Minute
// current_version is the current version of the notification listener.
current_version = swapserverrpc.SubscribeNotificationsRequest_V1
)
// Client is the interface that the notification manager needs to implement in
@ -260,7 +263,9 @@ func (m *Manager) subscribeNotifications(ctx context.Context) error {
defer cancel()
notifStream, err := m.cfg.Client.SubscribeNotifications(
callCtx, &swapserverrpc.SubscribeNotificationsRequest{},
callCtx, &swapserverrpc.SubscribeNotificationsRequest{
Version: current_version,
},
)
if err != nil {
return err