Skip to content

Conversation

lunny
Copy link
Member

@lunny lunny commented Aug 1, 2025

Fix #35194

Related to #32339

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 1, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Aug 1, 2025
@wxiaoguang
Copy link
Contributor

I don't think the code reads right. The deadline_unix is null-able in database IIRC.

@lunny
Copy link
Member Author

lunny commented Aug 2, 2025

I don't think the code reads right. The deadline_unix is null-able in database IIRC.

1bafbb6

@lunny lunny requested a review from a team August 8, 2025 22:07
Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks clustered, but did not come up with something better jet :/

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 29, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Aug 29, 2025

Related to #32339

Well, I regretted that I approved 32339 ..... and I think we shouldn't add more patches.

If you search "deadline_unix" in the code base, you can see there are more places using it for comparing and sorting.

So the correct fix should be introducing a very large magic unix timestamp for "no due date", but never use it as a real date/time struct

@6543
Copy link
Member

6543 commented Sep 7, 2025

I think magic values are not good and should mostly be avoided ...

... new maintainers just get confused ...
... so the tend to be hatder to maintain
... as the name already implyes with magic, the meaning is not clear at first sight and you have to dig deep into why what appens for each of such values
... that should be documented, but we know about docs being ... just what they are now :/
... if set you need to migrate stuf if you need to change it

but it would make the db query shorter yes ... :/

🤔

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Sep 7, 2025

I don't like magic numbers and seldom use them.

But for this case, if you can make sure:

  • all "deadline_unix" related SQLs are written correctly (fix all other places)
  • complex SQLs should be covered by tests
  • future developers won't make such low-level mistakes (help them to fix all "order by deadline_unix" and "deadline_unix < ?" bugs)

Then just do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sorting order of milestones changed in 1.24.3 release (docker)
4 participants