Repository navigation
[2.1] Fixes #36393: List tasks newest first by creation time - #36453
Merged
Merged
Conversation
* fix(tasks): list tasks newest first by creation time The task list endpoints (/v1/tasks, /assigned, /visible, /owned, /created) paged by the generic (name, id) keyset, so the Inbox Triage queue and the notification bell showed the oldest tasks first. Task names are TASK-%05d strings compared as text, and the 2.0 migration numbered suggestions before thread tasks, so name order is not creation order even when reversed. The endpoints now page by a (createdAt, id) keyset, newest first, with an optional sortOrder=asc|desc. The order is opt-in on the ListFilter, so the search reindex keeps the name keyset its offset-seeded cursors rely on. A name cursor issued before this change returns 400 instead of a 500. * test(tasks): scoped list ordering checks this test's own tasks testScopedListsReturnNewestFirst created unassigned tasks on an unowned table, so /assigned and /owned could pass on empty pages. File tasks assigned to user1 and by user1 on a user1-owned table in a fresh domain, list each endpoint as user1 scoped to that domain, and require every expected task on the page before checking the order. * refactor(tasks): tighten task list ordering code - TaskListOrder takes the asc/desc param and derives the SQL direction; a previous page reuses the opposite order's operator and direction. - @TaskListOrder.BindPage supplies operator, directions and cursor to the createdAt keyset queries, so each takes four parameters. - asc/desc are defined once and reused by the endpoint annotations. - TaskDAO only adds the createdAt branch; main's listAfter/listBefore branches and name-ordered search SQL are left untouched. - Integration tests split into helpers, cursor built from a typed record. (cherry picked from commit af85654)
gh-bot-collate
Bot
requested review from
mohityadav766
and removed request for
a team
October 28, 2026 12:29
Author
|
🤖 This backport will not merge itself: |
12 of 14 tasks
|
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Automated backport of #36395 to
2.1.af85654b4acc90a3f4f24e7ae7e2b7a98f6cb3ebmain.Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #36395 is asked to look.
resolver run