Bug #3692
closed[API] Eventbus filters parameter should use implicit AND (like REST filters) instead of implicit OR.
Related issues
Updated by Peter Amstutz about 10 years ago
- Target version set to 2014-10-29 sprint
Updated by Peter Amstutz about 10 years ago
- Category set to API
- Status changed from New to In Progress
- Assigned To set to Peter Amstutz
Updated by Brett Smith about 10 years ago
Reviewing c088fcf
I am consistently getting UUID mismatches in the new test:
1) Failure: WebsocketTest#test_connect,_subscribe,_multiple_filters [/home/brett/repos/arvados/services/api/test/integration/websocket_test.rb:240]: <"zzzzz-7a9it-hwe3vpcyrk8iv3j"> expected but was <"zzzzz-j58dm-l6egg61nr8lxalp">. 302 tests, 997 assertions, 1 failures, 0 errors, 0 skips
The last part of the UUIDs are random, but the second part of the mismatch (7a9it expected vs. j58dm) is consistent.
Code-wise, my only concern is that #{cond_out.join ') OR ('}
is dead code that could potentially confuse a reader, now that the conditions are already joined earlier. I think you could clear this up by rolling back the changes to the ws.filters.each
block, and then changing OR
to AND
here. But I'd be happy with any change that only has one join on cond_out
rather than two.
Thanks.
Updated by Peter Amstutz about 10 years ago
Brett Smith wrote:
Reviewing c088fcf
I am consistently getting UUID mismatches in the new test:
[...]
The last part of the UUIDs are random, but the second part of the mismatch (7a9it expected vs. j58dm) is consistent.
Fixed.
Code-wise, my only concern is that
#{cond_out.join ') OR ('}
is dead code that could potentially confuse a reader, now that the conditions are already joined earlier. I think you could clear this up by rolling back the changes to thews.filters.each
block, and then changingOR
toAND
here. But I'd be happy with any change that only has one join oncond_out
rather than two.
I think you're misunderstanding the purpose of the bug fix here. The clauses within a single filter are joined with AND, but if there are multiple subscriptions, the compound filter statements are joined with OR. Added a a couple comments to try and clarify.
Updated by Brett Smith about 10 years ago
Peter Amstutz wrote:
Brett Smith wrote:
Code-wise, my only concern is that
#{cond_out.join ') OR ('}
is dead code that could potentially confuse a reader, now that the conditions are already joined earlier. I think you could clear this up by rolling back the changes to thews.filters.each
block, and then changingOR
toAND
here. But I'd be happy with any change that only has one join oncond_out
rather than two.I think you're misunderstanding the purpose of the bug fix here. The clauses within a single filter are joined with AND, but if there are multiple subscriptions, the compound filter statements are joined with OR. Added a a couple comments to try and clarify.
Okay, I get it now, thanks for explaining. b8fdb90 is good to merge, thanks.
Updated by Anonymous about 10 years ago
- Status changed from In Progress to Resolved
- % Done changed from 67 to 100
Applied in changeset arvados|commit:593316198c1647b24f66a64e4a0f7a34e75b54ab.