Collections: filter dates require full ISO strings
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 296
- Forks
- 86
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 50
Description
When calling out the Collections REST API, we can filter queries by date with created_before, created_after, updated_before, updated_after.
These dates should be any partial ISO 8601 strings, which round to the earliest/latest resolution. So basically if I say created_before=2024-12-08 It'll return anything created before the start of the 8th of December
Per the spec:
updated_after / created_after only returns records GTE this the start of (last second? of) this date
updated_before / created_before only returns records LTE the end of (last second? of) this date
Note: uh is that spec inverted? Anything created before 8th december should not be include. If doing created after, then also anything created on dec 8 should be excluded. I suppose you could also do created_at which includes anything inside that interval - so created_at=2024-12-08 should return anything created on the 8th december.
Anyway, I can simulate this behaviour in the adaptor, but the backing API should really be providing this behaviour
Reproduction
This returns a 400 bad request
curl -X GET http://localhost:4000/collections/stuff?updated_after=2024-12-06 -H "Authorization: Bearer $OPENFN_PAT"
But this is fine:
curl -X GET http://localhost:4000/collections/stuff?updated_after=2024-12-06T12:00:12.177825Z -H "Authorization: Bearer $OPENFN_PAT"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Collections REST API date-filter handling and reproduce the issue with the provided curl commands. Review issue 2566 for the intended boundary semantics; done means partial ISO 8601 dates are accepted for the date query parameters with documented, tested start/end-of-day behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100