-
Notifications
You must be signed in to change notification settings - Fork 761
Open
Labels
#g-orchestrationOrchestration product groupOrchestration product group:productProduct Design department (shows up on 🦢 Drafting board)Product Design department (shows up on 🦢 Drafting board)bugSomething isn't working as documentedSomething isn't working as documented~backendBackend-related issue.Backend-related issue.~released bugThis bug was found in a stable release.This bug was found in a stable release.
Description
Fleet version: <= 4.80 (released)
💥 Actual behavior
Per this code and this discussion, we have nuances in activities API filtering that behave differently than the docs for that endpoint.
Specifically, if you don't provide activity date filters at all, we don't filter the database query by date, but if you provide start and not end the database query adds now as the end date on the filter. Right now we don't future-date activities to my knowledge so this is a distinction without a difference, but the explicit "now" filter does give us unnecessary differing behavior based on a different query parameter than one would expect.
🛠️ To fix
One of the following:
- Always filter activities to
created_at <= nowby default, with an override only when end_created_at is set. - Only filter activities to
created_at <= ?if end_created_at is set (because no activities in the table we're looking at will be future-dated anyway).
🧑💻 Steps to reproduce
- Manually insert an activity into the
activitiestable with acreated_atdate in the future - Call the List activities endpoint with no parameters. You will see the above activity.
- Call the List activities endpoint with only
start_created_atset (to a time in the past). You will not see the above activity.
🕯️ More info
Inconsistency discovered during review of #38115.
Metadata
Metadata
Assignees
Labels
#g-orchestrationOrchestration product groupOrchestration product group:productProduct Design department (shows up on 🦢 Drafting board)Product Design department (shows up on 🦢 Drafting board)bugSomething isn't working as documentedSomething isn't working as documented~backendBackend-related issue.Backend-related issue.~released bugThis bug was found in a stable release.This bug was found in a stable release.
Type
Projects
Status
📨 Inbox