Skip to content

Unassigned filter based on detecting the string null#2147

Open
smutniak wants to merge 1 commit intomainfrom
main_2119_unassigned
Open

Unassigned filter based on detecting the string null#2147
smutniak wants to merge 1 commit intomainfrom
main_2119_unassigned

Conversation

@smutniak
Copy link
Copy Markdown
Contributor

@smutniak smutniak commented May 5, 2026

Fixes #2119

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 on lines 799 to +802
if (filterString == null) {
sqlBuilder.append("a.email IS NULL");
} else if (filterString.equalsIgnoreCase("null")) {
sqlBuilder.append("a.email IS NULL");
Comment on lines 803 to 805
} else if (submissionListColumn.getExactMatch()) {
sqlBuilder.append("a.email = '").append(filterString).append("'");
} else {
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

2 participants