Skip to content

dbeaver/pro#11947 Add server-side users sorting and pagination - #4988

Open
sergeyteleshev wants to merge 22 commits into
develfrom
dbeaver/pro#11947-users-filter-pagination
Open

sergeyteleshev wants to merge 22 commits into
develfrom
dbeaver/pro#11947-users-filter-pagination

Conversation

@sergeyteleshev

@sergeyteleshev sergeyteleshev commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Closes dbeaver/pro#11947

Summary

Apply search, status, multiple-role filters, and sorting before server pagination so results cover the full users list. Sort by username, role, status, or last login; reset scroll when filters or sorting change.

Architecture

Reuse useOffsetPagination and useResource. In core-authentication, UsersResourceListKey identifies server-ordered lists and supports cache invalidation; legacy filter keys remain supported. core-sdk forwards optional ordering to listUsers. These shared resource/API contracts belong in core; the table controls stay in the administration plugin.

flowchart LR
  UI["Users table · changed"] -->|existing resource flow| R["UsersResource · changed"]
  R -->|new order and role filters| API["listUsers · changed"]
Loading

Existing API calls retain username-ascending order. No domain entities or relationships change.

Dependencies

Merge dbeaver/dbeaver#43209 first. CSV export integration: dbeaver/cloudbeaver-ee#2870.

Verification

Frontend build and formatting passed. Branch-wide ESLint: no errors, three return-type warnings; GraphQL is outside ESLint scope. Shared pagination edge cases remain a follow-up.

AI-assisted with OpenCode.

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T23:05:32.283753Z 98cf424 Manual request
🔒 Security Review ✅ Completed 2026-12-01T15:05:28.832654Z da56972 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codacy-production

codacy-production Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 39 complexity

Metric Results
Complexity 39

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da56972bac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +114 to +120
if (!resource.isIntersect(targetKey, pagination._target)) {
pagination._key = createPageKey(offset, pageSize, targetKey);
pagination._target = targetKey;
runInAction(() => {
resource.offsetPagination.reset(pagination._key);
pagination._target = targetKey;
pagination._key = createPageKey(CACHED_RESOURCE_DEFAULT_PAGE_OFFSET, pageSize, targetKey);
pagination.reset();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Commit focused tests for the new pagination lifecycle

This changes shared pagination state, filter switching, and pending-response invalidation without adding any tests, leaving cases such as A → B → A with overlapping requests and the 100/101-result boundary unprotected. Add the focused regression tests alongside the affected packages rather than relying on the documented manual scenarios.

AGENTS.md reference: AGENTS.md:L74-L74

Useful? React with 👍 / 👎.

@sergeyteleshev sergeyteleshev changed the title dbeaver/pro#11947 Reset Users pagination when server filters change dbeaver/pro#11947 Add server-side users sorting and pagination Dec 1, 2026
@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

Updated in 48243cd: server-side sorting for name, role, status, and last login; preserves server page order in the cache. Pagination resets now happen in the commit phase. Companion model PR: dbeaver/dbeaver#43209.

Regression tests remain local and uncommitted for the author’s review as previously agreed; the test-coverage review finding remains outstanding for merge.

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 48243cdb79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b174736a8f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e02c1ee6c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9a34d22be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: b125ff7dcd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@codacy-production

codacy-production Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 43 complexity

Metric Results
Complexity 43

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: d9f232128c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 60ad9439fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 332af7e29d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

A few notes on the review questions:

  • Role updates: removed the direct onDataOutdated call because markOutdated() already sends that event, either after a standalone role change or at the end of a successful form save.
  • Pagination: calculate the next offset from the current page because the cache-derived offset can return to zero after all rows are loaded, causing the second page to repeat instead of advancing to the third.
  • Disable: allow resource invalidation because Disable saves immediately without a later Save action, so the table needs to refresh its status, filtering, and ordering right away.

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e68baf28ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df6b0926c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sergeyteleshev

Copy link
Copy Markdown
Member Author

@codex review

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 43 complexity

Metric Results
Complexity 43

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98cf424c0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

List<String> whereParts = new ArrayList<>();
if (!CommonUtils.isEmpty(filter.getUserIdMask())) {
whereParts.add("USER_ID LIKE ?");
whereParts.add("LOWER(USER_ID) LIKE LOWER(?)" + (filter.isLiteralSearch() ? " ESCAPE '!'" : ""));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply case-insensitive filtering when loading user metadata

On PostgreSQL or Oracle, a case-insensitive search can now select a mixed-case user here, but readSubjectsMetas subsequently reuses the original mask with a case-sensitive SUBJECT_ID LIKE ?. For example, searching john returns user John while omitting that user's metaParameters from listUsers responses that request them; load metadata by the selected result IDs or apply the same case-insensitive predicate there.

AGENTS.md reference: AGENTS.md:L93-L93

Useful? React with 👍 / 👎.

Comment on lines +1170 to +1171
if (filter.isLiteralSearch()) {
mask = mask.replace("!", "!!").replace("%", "!%").replace("_", "!_");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Escape SQL Server bracket wildcards in literal searches

When CloudBeaver uses SQL Server and the search contains [, this branch does not preserve literal-substring semantics because SQL Server LIKE treats bracket expressions as patterns. For example, searching for team[1] can match team1 rather than the literal user ID; escape [ with the configured escape character in addition to !, %, and _.

AGENTS.md reference: AGENTS.md:L93-L93

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant