Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed XPath filters fail silently at client side. #33

Closed
timstaley opened this issue Aug 5, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@timstaley
Copy link
Contributor

commented Aug 5, 2014

I can start Comet with an XPath filter, like so:

 twistd -n comet --remote localhost \
    --filter='not(starts-with(@ivorn,"ivo://voevent.phys.soton.ac.uk/FOO"))'

which works fine. But, if the XPath is broken, e.g.

--filter='not(starts-with(@ivorn,"ivo://voevent.phys.soton.ac.uk/FOO"'

(note missing close brackets), then Comet will start up quietly and the filter will silently fail. Currently, the only way to check if the XPath translates to a successfully installed filter is to monitor the logs at the server end.

@jdswinbank

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2014

This is addressed by b1e83bd. In the event of an XPath syntax error, Comet will refuse to start as follows:

$ twistd-2.7 -n comet --remote=localhost --filter='not(starts-with(@ivorn,"ivo://voevent.phys.soton.ac.uk/FOO"'
[...]
/opt/local/bin/twistd-2.7: Invalid XPath expression: not(starts-with(@ivorn,"ivo://voevent.phys.soton.ac.uk/FOO"

Note that this is just checking the XPath for syntax correctness. There's no mechanism for the broker to report back to the subscriber that the filter has been accepted and installed successfully; indeed, brokers which are not Comet should simply silently ignore the filter and you'll get no feedback that that's what they're doing.

Does this solve your problem?

@timstaley

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2014

Sounds sensible, this should at least catch the stupidest errors, that's all you can do without case-by-case unit / integration testing, I think. Thanks!

@jdswinbank

This comment has been minimized.

Copy link
Owner

commented Aug 12, 2014

Ok, thanks for the feedback.

I don't think it's worth doing a 1.1.2 release just for this, but when I get around to fixing #31 I'll roll them both into a point release.

@jdswinbank jdswinbank closed this Aug 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.