Skip to content

Conversation

@nibix
Copy link
Collaborator

@nibix nibix commented Aug 4, 2025

Description

In a couple of cases, OpenSearch calls LeafReader methods with null fieldName parameters. The semantics of this are a bit unclear; in most cases, the underlying LeafReader methods will just also return null. However, I cannot prove that this will be always the case.

Thus, the change in this PR does not try to put semantics into this; it just handles the null case gracefully by using a NPE safe replacement value. That has the effect that users with high restrictions will also get an restriction enforced on the result returned in the null cases. Users without restrictions will be still passed through to the underlying LeafReader.

See also #5504

  • Category: Bug fix
  • Why these changes are required? Diverse NPE issues
  • What is the old behavior before changes and new behavior after changes?

Issues Resolved

Fixes opensearch-project/OpenSearch-Dashboards#9873

Testing

  • Unit test
  • Manual test

Check List

  • New functionality includes testing
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

… methods

Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.95%. Comparing base (25fe5f8) to head (9ef236e).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5537      +/-   ##
==========================================
+ Coverage   72.88%   72.95%   +0.06%     
==========================================
  Files         400      405       +5     
  Lines       24935    25161     +226     
  Branches     3806     3829      +23     
==========================================
+ Hits        18173    18355     +182     
- Misses       4912     4946      +34     
- Partials     1850     1860      +10     
Files with missing lines Coverage Δ
...earch/security/privileges/dlsfls/FieldMasking.java 86.82% <100.00%> (-0.24%) ⬇️
...ch/security/privileges/dlsfls/FieldPrivileges.java 95.36% <100.00%> (+0.06%) ⬆️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cwperks
Copy link
Member

cwperks commented Aug 4, 2025

Thank you for the quick fix @nibix !

Signed-off-by: Craig Perkins <cwperx@amazon.com>
cwperks
cwperks previously approved these changes Aug 4, 2025
Signed-off-by: Nils Bandener <33570290+nibix@users.noreply.github.com>
RyanL1997
RyanL1997 previously approved these changes Aug 6, 2025
cwperks
cwperks previously approved these changes Aug 6, 2025
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks cwperks dismissed stale reviews from RyanL1997 and themself via 9ef236e August 6, 2025 17:00
@cwperks cwperks merged commit 3ef75f4 into opensearch-project:main Aug 6, 2025
71 checks passed
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.

[BUG] Enabling "Show Missing Values" on visualisation causes error since 3.0.0

4 participants