Skip to content

Add 'until' to API routes that list things#752

Merged
f-f merged 2 commits into
masterfrom
f-f/add-until-to-api
Feb 8, 2026
Merged

Add 'until' to API routes that list things#752
f-f merged 2 commits into
masterfrom
f-f/add-until-to-api

Conversation

@f-f
Copy link
Copy Markdown
Member

@f-f f-f commented Feb 7, 2026

The fact that having only the since parameter in the API routes was not very ergonomic already came up in previous discussions with @thomashoneyman, but trying to put together a dashboard for the logs (as per #742) cemented this idea.

Here we add an until parameter, so that the default when neither since nor until are provided is that we fetch the last items until now, which I think is a sensible default.

Bonus: we add a CORS middleware as well here, also needed for the dashboard.

@f-f f-f requested a review from thomashoneyman February 7, 2026 11:47
Comment thread app/src/App/Server/Router.purs Outdated
Comment thread app/src/App/SQLite.js Outdated
Comment thread app/src/App/SQLite.js Outdated
@f-f
Copy link
Copy Markdown
Member Author

f-f commented Feb 8, 2026

@thomashoneyman good catch with that review – I have reworked the design so it's cleaner:

  • the range is now [since,until) as per the comments
  • I realised that it made no sense to leave since/until unspecified since we know the lower bound for since (the registry launch) and the upper bound for until (now, as we can't have logs/jobs in the future), so I made them only optional at the API boundary, but they are always known at the database layer. This makes for simpler queries
  • the missing piece was the "ordering" parameter, clients need to be able to pass that in. So now we default to ASC (for backwards compatibility), but clients can pass DESC as well

@f-f f-f merged commit a0a7a51 into master Feb 8, 2026
16 checks passed
@f-f f-f deleted the f-f/add-until-to-api branch February 8, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants