Fix handling of watch members in host store - #71
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
ChangesWatch membership synchronization
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Store
participant Watch
participant EventConsumer
Store->>Watch: Enqueue object event
Watch->>Watch: Lock membership and evaluate filter
Watch->>Watch: Update tracked object IDs
Watch-->>EventConsumer: Forward update or synthetic delete
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@storeutils/host/store.go`:
- Around line 283-303: Update Store.Watch so the initial s.List snapshot and
watcher registration form one consistent boundary under the store’s
event-publication coordination. Prevent create, update, or delete operations
from being published between snapshot capture and watches.Insert, or capture a
revision and replay all events from that revision before registration; ensure
the watcher’s members and event stream include every change after the snapshot.
- Around line 371-379: Update the event handling around handler.matches so
store.WatchEventTypeDeleted events are processed first: remove the ID and
forward the deletion only when handler.members already contains it. Run the
existing selector matching and transition logic only for non-deleted events,
preserving current behavior for matching and out-of-scope objects.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 170d8ae3-b4eb-4225-bbf6-38d7ba61a182
📒 Files selected for processing (2)
storeutils/host/store.gostoreutils/host/watch.go
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
lukasfrank
left a comment
There was a problem hiding this comment.
Can you maybe add some simple tests?
Signed-off-by: Daniel Gonzalez Nothnagel <daniel.gonzalez.nothnagel@sap.com>
Signed-off-by: Daniel Gonzalez Nothnagel <daniel.gonzalez.nothnagel@sap.com>
Deleted events previously went through the filter matcher, which could silently drop them if the object no longer matched the watch's predicate. Signed-off-by: Daniel Gonzalez Nothnagel <daniel.gonzalez.nothnagel@sap.com>
Signed-off-by: Daniel Gonzalez Nothnagel <daniel.gonzalez.nothnagel@sap.com>
6cc57a9 to
e2acaff
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@storeutils/host/store_test.go`:
- Line 247: Wrap the long Dummy object literals in the test cases around
dummyStore.Create, including the cases using IDs "delete-untracked" and the line
260 counterpart, so each stays within the 120-character limit without changing
test behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 89ef8a1c-c442-4117-8137-7f3859eb9943
📒 Files selected for processing (3)
storeutils/host/store.gostoreutils/host/store_test.gostoreutils/host/watch.go
🚧 Files skipped from review as they are similar to previous changes (2)
- storeutils/host/watch.go
- storeutils/host/store.go
Signed-off-by: Daniel Gonzalez Nothnagel <daniel.gonzalez.nothnagel@sap.com>
e2acaff to
2ef3f2c
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Signed-off-by: Daniel Gonzalez Nothnagel <daniel.gonzalez.nothnagel@sap.com>
Proposed Changes
matched objects from the start
Summary by CodeRabbit