Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

fix: Condition ClientID updates and watcher notifications on command success #1680

Merged
merged 1 commit into from
May 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions internal/server/ironhawk/iothread.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ func (t *IOThread) StartSync(ctx context.Context, shardManager *shardmanager.Sha
// Also, CLientID is duplicated in command and io-thread.
// Also, we shouldn't allow execution/registration incase of invalid commands
// like for B.WATCH cmd since it'll err out we shall return and not create subscription
t.ClientID = _c.ClientID
if err == nil {
t.ClientID = _c.ClientID
}

if c.Cmd == "HANDSHAKE" {
if c.Cmd == "HANDSHAKE" && err == nil {
t.ClientID = _c.C.Args[0]
t.Mode = _c.C.Args[1]
}
Expand All @@ -79,7 +81,9 @@ func (t *IOThread) StartSync(ctx context.Context, shardManager *shardmanager.Sha

// TODO: Streamline this because we need ordering of updates
// that are being sent to watchers.
watchManager.NotifyWatchers(_c, shardManager, t)
if err == nil {
watchManager.NotifyWatchers(_c, shardManager, t)
}
}
}

Expand Down