Skip to content

Allow == and != against empty string - #401

Merged
mgaffigan merged 1 commit into
OpenIntegrationEngine:mainfrom
mgaffigan:feat/search-empty-metadata
Oct 31, 2026
Merged

mgaffigan merged 1 commit into
OpenIntegrationEngine:mainfrom
mgaffigan:feat/search-empty-metadata

Conversation

@mgaffigan

@mgaffigan mgaffigan commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #300

Example channel for testing
search for empty string.xml

Test matrix:

  1. Searching for == '' works on message with matching empty metadata
  2. Searching for != '' works on message with matching populated metadata
  3. Searching for == '' does not match on message with populated metadata
  4. Searching for != '' does not match on message with empty metadata
  5. Other filter operators continue being ignored if the value is ''

Not supported on Oracle.

@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Test Results

130 files  +1  130 suites  +1   3m 23s ⏱️ +41s
792 tests +3  792 ✅ +3  0 💤 ±0  0 ❌ ±0 
918 runs  +3  912 ✅ +3  6 💤 ±0  0 ❌ ±0 

Results for commit e3f3230. ± Comparison against base commit f2ac43d.

♻️ This comment has been updated with latest results.

@pacmano1

pacmano1 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Is "metadata explicitly set to empty string" the intended scope? Blank == won't match messages where the variable was never set — those are NULL in D_MCM (or no row at all if the message had no metadata), and the admin tool renders all three states identically as blank. Having dug in, ''-only looks like the only clean semantics short of restructuring the search, so maybe just worth a line in the PR body.

Oracle is the real problem: verified against Oracle 23 Free with ojdbc8 that setString("") into the VARCHAR2(255 CHAR) metadata column stores NULL, and a bound '' matches zero rows with both = and !=. So on Oracle blank == can never match, and blank != goes from "row ignored" to "always zero results". Suggest an IS NULL/IS NOT NULL special case in oracle-message.xml, or an explicit "not supported on Oracle" note.

@mgaffigan

Copy link
Copy Markdown
Contributor Author

@pacmano1, the intent is indeed "empty string". I agree that a future "not set" filter may be valuable (especially on oracle, which weirdly considers '' is null to be true).

@kryskool

Copy link
Copy Markdown
Contributor

Hi @mgaffigan

Why not use a new "null or empty" checkbox instead of leaving the value field blank, which can be ambiguous?
this would make it easier to handle the issue raised by @pacmano1

Regards,

@mgaffigan

Copy link
Copy Markdown
Contributor Author

Why not use a new "null or empty" checkbox instead of leaving the value field blank, which can be ambiguous?

Because equals empty was already supported by the backend, it only required the client to allow it.

I agree that future work to compare null would be useful.

@tonygermano tonygermano added the enhancement New feature or request label Oct 6, 2026
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
@mgaffigan
mgaffigan force-pushed the feat/search-empty-metadata branch from 2b2d4fe to e3f3230 Compare October 31, 2026 19:35
@jonbartels

Copy link
Copy Markdown
Contributor

Leaving a note for the bot - This issue should be higlighted in the release notes. It is a useful UI feature.

@jonbartels jonbartels 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.

I reviewed the code and tests. Pretty neat that the backend supported this already.

@mgaffigan
mgaffigan merged commit d7cf54d into OpenIntegrationEngine:main Oct 31, 2026
11 checks passed
@mgaffigan
mgaffigan deleted the feat/search-empty-metadata branch October 31, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Can't search for empty metadata

6 participants