~sircmpwn/todo.sr.ht#259: 
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 {
                id
                created
            }
        }
    }
}
Status
REPORTED
Submitter
~xenrox
Assigned to
Submitted
2 years ago
Updated
2 years ago
Labels
No labels applied.

~bitfehler 2 years 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 years 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 years ago

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

~sircmpwn 2 years ago

Conrad Hoffmann referenced this ticket in commit c28e447.

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