Skip to content

Unassigned filter based on detecting the string null#2147

Open
smutniak wants to merge 2 commits into
mainfrom
main_2119_unassigned
Open

Unassigned filter based on detecting the string null#2147
smutniak wants to merge 2 commits into
mainfrom
main_2119_unassigned

Conversation

@smutniak

@smutniak smutniak commented May 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #2119

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the “Assigned To = Unassigned” filter returning no results by treating the literal string "null" (as received from the client/filter serialization) the same as an actual null filter value when building the dynamic submission list SQL.

Changes:

  • Update assignee.email filter SQL generation to interpret "null" as an “unassigned” sentinel and generate IS NULL predicates accordingly.
Comments suppressed due to low confidence (1)

src/main/java/org/tdl/vireo/model/repo/impl/SubmissionRepoImpl.java:807

  • This change introduces support for the literal string "null" as the Unassigned filter value, but there is no regression test covering it. Please add a backend test (integration or repo-level) that creates assigned + unassigned submissions and asserts the "assignee.email" filter with filterValue "null" returns only the unassigned submissions.
                    for (String filterString : submissionListColumn.getFilters()) {
                        sqlBuilder = new StringBuilder();

                        if (filterString == null) {
                            sqlBuilder.append("a.email IS NULL");
                        } else if (filterString.equalsIgnoreCase("null")) {
                            sqlBuilder.append("a.email IS NULL");
                        } else if (submissionListColumn.getExactMatch()) {
                            sqlBuilder.append("a.email = '").append(filterString).append("'");
                        } else {
                            sqlBuilder.append("LOWER(a.email) LIKE '%").append(escapeString(filterString)).append("%'");
                        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/org/tdl/vireo/model/repo/impl/SubmissionRepoImpl.java Outdated
Comment on lines 803 to 805
} else if (submissionListColumn.getExactMatch()) {
sqlBuilder.append("a.email = '").append(filterString).append("'");
} else {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This requires a bigger change than just this location. Also this value comes from the database rather than 'user input'.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

Filter by Assigned To 'Unassigned' returns no results

3 participants