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 dashboard validation bug by making stream field comparison case-insensitive. The issue occurred in the validateStreamFields function within convertDataIntoUnitValue.ts, where field name validation was performing exact string matching between query field names (it.column) and available stream field names (i.name). This caused false validation errors when field names had different casing conventions - for example, when frontend code used camelCase field names but the backend provided snake_case equivalents.

The fix normalizes both field names to lowercase using .toLowerCase() before comparison in two locations: the X-axis field validation (line 1212) and Y-axis field validation (line 1230). This change ensures that fields like userName and user_name are correctly recognized as the same field during validation.

This change integrates well with OpenObserve's dashboard system, which needs to handle field names that may be transformed during data processing pipelines. The case-insensitive approach is common in data systems where field naming conventions can vary between different layers of the application stack, making this a pragmatic solution for improving user experience by eliminating confusing validation errors.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it only affects field validation logic without changing core functionality
  • Score reflects a simple, well-targeted bug fix that addresses a clear validation issue with no side effects
  • No files require special attention - the change is isolated and straightforward

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@ktx-vaidehi ktx-vaidehi merged commit 717215d into branch-v0.14.6-rc7 Sep 15, 2025
49 of 50 checks passed
@ktx-vaidehi ktx-vaidehi deleted the fix/dashboard/camel-case-issue-rc7 branch September 15, 2025 06:45
hengfeiyang pushed a commit that referenced this pull request Sep 15, 2025
…lidation for camelCase (#8424) (#8428)

…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]>
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