Skip to content

[2.1] Fixes #36393: List tasks newest first by creation time - #36453

Merged
yan-3005 merged 1 commit into
2.1from
backport/2.1/pr-36395
Oct 28, 2026
Merged

yan-3005 merged 1 commit into
2.1from
backport/2.1/pr-36395

Conversation

@gh-bot-collate

Copy link
Copy Markdown

Automated backport of #36395 to 2.1.

Source PR #36395
Author @yan-3005
Merge commit af85654b4acc90a3f4f24e7ae7e2b7a98f6cb3eb
Method Clean cherry-pick — identical to the commit on main.

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

* 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
gh-bot-collate Bot requested a review from a team as a code owner October 28, 2026 12:29
@gh-bot-collate
gh-bot-collate Bot requested review from mohityadav766 and removed request for a team October 28, 2026 12:29
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Oct 28, 2026
@gh-bot-collate

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.1 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

@yan-3005
yan-3005 merged commit c2ea51f into 2.1 Oct 28, 2026
77 checks passed
@yan-3005
yan-3005 deleted the backport/2.1/pr-36395 branch October 28, 2026 12:49
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant