Zero timestamp causes GraphQL queries to fail

With such a timestamp it is no longer possible to query the "created" field on tickets. The API will return the error "must not be null". Example query:

query {
    trackerByOwner(owner: "~emersion", tracker: "hut") {
        tickets {
            results {
Assigned to
2 months ago
a month ago
No labels applied.

~bitfehler 2 months ago

So, for all I can tell, the culprit here is (at least) this ticket: https://todo.sr.ht/~emersion/hut/17 (note the "Submitted 2,022 years ago").

Wouldn't it maybe make more sense to either purge tickets with such a timestamp from the database or set a different one? Fixing this would likely mean fighting generated code, and I don't think this can ever happen again once we fixed it, right?

~xenrox 2 months ago

With the current GraphQL implementation users can always generate such a ticket by setting the timestamp to the zero value (default in go). So there needs to be at least a validation that would forbid such tickets from being created ever again.

~sircmpwn 2 months ago

We should fix the bug and then remove or correct any invalid records.

~sircmpwn a month ago

Conrad Hoffmann referenced this ticket in commit c28e447.

Register here or Log in to comment, or comment via email.