Skip to content

Align behaviour of after on AuditEvent repository and endpoint with Java Time's after methods #11612

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

Closed
wilkinsona opened this issue Jan 12, 2018 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

The name after implies to me that if I pass in the exact time at which an event occurred then I will not see that event in the returned list as it did not occur after the given time. The name after and what it implies (to me at least) conflicts with how the parameter is documented in AuditEventRepository where it says that it is the "timestamp of earliest result required (or null if unrestricted)". The endpoint's HTTP API documentation is aligned with my interpretation of it being called after (unsurprising, as I wrote those docs). It describes the parameter as restricting the returned events "to those that occurred after the given time".

The current implementation is aligned with the parameter description. Rather than returning events that occurred after the given time, it returns events that occurred at the given time or later. As we move to using Instant (#10976) this confusion is likely to increase as its isAfter method returns false if the two instances being compared are equal.

I think we should keep the name after and align the behaviour with Java Time.

@wilkinsona wilkinsona added this to the 2.0.0.RC1 milestone Jan 12, 2018
@wilkinsona wilkinsona self-assigned this Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant