Skip to content

Conversation

@ktx-vaidehi
Copy link
Collaborator

…lidation for camelCase (#8424)

PR Type

Bug fix


Description

  • Make stream field validation case-insensitive

  • Prevent false errors for camelCase vs snake_case


Diagram Walkthrough

flowchart LR
  A["Query field names"] -- "toLowerCase()" --> B["Normalized names"]
  C["Available stream fields"] -- "toLowerCase()" --> D["Normalized fields"]
  B -- "compare" --> D
  E["Errors array"] -- "only push if unmatched" --> F["Accurate validation"]
Loading

File Walkthrough

Relevant files
Bug fix
convertDataIntoUnitValue.ts
Case-insensitive comparison for stream field validation   

web/src/utils/dashboard/convertDataIntoUnitValue.ts

  • Compare field names using toLowerCase().
  • Avoid mismatch when cases differ (e.g., camelCase).
  • Update filter predicate for custom X field errors.
+4/-1     


…lidation for camelCase (#8424)

### **PR Type**
Bug fix


___

### **Description**
- Make stream field validation case-insensitive

- Prevent false errors for camelCase vs snake_case


___

### Diagram Walkthrough


```mermaid
flowchart LR
  A["Query field names"] -- "toLowerCase()" --> B["Normalized names"]
  C["Available stream fields"] -- "toLowerCase()" --> D["Normalized fields"]
  B -- "compare" --> D
  E["Errors array"] -- "only push if unmatched" --> F["Accurate validation"]
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
  <td>
    <details>

<summary><strong>convertDataIntoUnitValue.ts</strong><dd><code>Case-insensitive
comparison for stream field validation</code>&nbsp; &nbsp;
</dd></summary>
<hr>

web/src/utils/dashboard/convertDataIntoUnitValue.ts

<ul><li>Compare field names using toLowerCase().<br> <li> Avoid mismatch
when cases differ (e.g., camelCase).<br> <li> Update filter predicate
for custom X field errors.</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8424/files#diff-14c6fe442ef231566ec411f9e0262cdd24ec912fc67b9154eec743282ab7211a">+4/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

---------

Co-authored-by: ktx-akshay <[email protected]>
@github-actions github-actions bot added the ☢️ Bug Something isn't working label Sep 15, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR fixes a case-sensitivity bug in the dashboard stream field validation logic within the validateStreamFields function. The change makes field name comparisons case-insensitive by converting both stream field names and query field names to lowercase using .toLowerCase() before comparison.

The modification affects two validation scenarios in web/src/utils/dashboard/convertDataIntoUnitValue.ts:

  1. X-axis field validation (lines 1207-1214)
  2. Y-axis field validation (lines 1225-1232)

Previously, the validation would fail when legitimate field selections had different casing conventions (e.g., userName vs username or created_at vs createdAt). This was causing false validation errors that prevented users from saving valid dashboard configurations. The fix ensures that field validation focuses on semantic field matching rather than strict string equality, which is more appropriate for data field validation where case variations are common but don't represent different fields.

This change integrates well with the existing dashboard validation system, maintaining all existing functionality while making the user experience more robust and forgiving of common casing variations in field names.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects a simple, well-targeted fix that addresses a clear UX issue without changing core logic
  • No files require special attention

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@ktx-vaidehi ktx-vaidehi merged commit d6ac8d9 into branch-v0.14.6-rc9 Sep 15, 2025
78 of 83 checks passed
@ktx-vaidehi ktx-vaidehi deleted the fix/dashboard/camel-case-issue-rc9 branch September 15, 2025 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☢️ Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants