Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: No data found was displayed after refreshing on logs page till logs are fetched#8678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
omkarK06 merged 2 commits intomainfromfix/logs-ui-no-data-found-on-refresh-main
Oct 31, 2025

Conversation

@omkarK06
Copy link
Contributor

@omkarK06omkarK06 commentedSep 29, 2025
edited by github-actionsbot
Loading

PR Type

Bug fix, Enhancement


Description

  • Prevent "No data" flash on refresh

  • Set loading true before logs fetch

  • Minor formatting for icon attributes

  • Normalize SQL mode checks spacing


Diagram Walkthrough

flowchart LR  Refresh["Logs tab refresh"] -- "set loading=true" --> Loading["Loading state"]  Loading -- "loadLogsData()" --> Fetch["Fetch logs"]  Fetch -- "results" --> UI["Render logs UI"]  UI -- "no flash of 'No data'" --> UX["Improved UX"]
Loading

File Walkthrough

Relevant files
Bug fix
Index.vue
Set loading before fetching logs; minor formatting             

web/src/plugins/logs/Index.vue

  • SetsearchObj.loading = true beforeloadLogsData() on logs tab.
  • Adjust icon tag formatting and line breaks.
  • Reformat SQL utils import over multiple lines.
  • Whitespace and spacing fixes in SQL mode checks.
+17/-9   

greptile-apps[bot] reacted with thumbs up emoji
@github-actionsgithub-actionsbot added ☢️ BugSomething isn't working Review effort 2/5 labelsSep 29, 2025
@github-actions
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Loading State

Loading is set to true before loadLogsData only when logs tab is active; ensure corresponding paths reliably set it back to false on both success and failure (including early returns or thrown errors) to avoid a stuck loading spinner.

restoreUrlQueryParams(dashboardPanelData);if (isEnterpriseClusterEnabled()) {  await getRegionInfo();}if (isLogsTab()) {  searchObj.loading = true;  loadLogsData();} else {  loadVisualizeData();
UI Consistency

The q-icon attributes are split across lines; verify linter/prettier settings and ensure no unintended whitespace/text-node changes or layout shifts, especially within inline headings.

                                 >                  <h5>                    <q-icon name="warning" color="warning"size="10rem" /><br />                    <div
SQL Mode Logic

The conditional for sqlMode was reformatted; confirm behavior is unchanged and that buildSearch is not called when sqlMode is true, and that logsPageQuery handles empty strings safely before isSimpleSelectAllQuery.

const handleRunQueryFn = async () => {  if (searchObj.meta.logsVisualizeToggle == "visualize") {    // wait to extract fields if its ongoing; if promise rejects due to abort just return silently    try {      let logsPageQuery = "";      // handle sql mode      if (!searchObj.meta.sqlMode) {        const queryBuild = buildSearch();        logsPageQuery = queryBuild?.query?.sql ?? "";      } else {        logsPageQuery = searchObj.data.query;      }      // Check if query is SELECT * which is not supported for visualization      if (        store.state.zoConfig.quick_mode_enabled === true &&        isSimpleSelectAllQuery(logsPageQuery)

@github-actions
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                   Impact
Possible issue
Ensure loading flag resets

EnsuresearchObj.loading is reset whenloadLogsData() completes or fails; currently
it may remain true if an error occurs. Wrap the async call and always clear the
loading flag in a finally block to prevent the UI from getting stuck in a loading
state.

web/src/plugins/logs/Index.vue [929-934]

 if (isLogsTab()) {   searchObj.loading = true;-  loadLogsData();+  try {+    await loadLogsData();+  } finally {+    searchObj.loading = false;+  } } else {-  loadVisualizeData();+  await loadVisualizeData();   searchObj.loading = false;+}
Suggestion importance[1-10]: 7

__

Why: Correctly identifies a potential stuck loading state and proposes using await/try/finally to reliably resetsearchObj.loading; impact is practical but not critical.

Medium
General
Normalize query before validation

*Trim the reconstructedlogsPageQuery to avoid false positives/negatives when
checking for "SELECT". Whitespace or trailing semicolons can bypass
isSimpleSelectAllQuery, leading to unsupported queries reaching visualization.

web/src/plugins/logs/Index.vue [1833-1849]

 if (searchObj.meta.logsVisualizeToggle == "visualize") {   // wait to extract fields if its ongoing; if promise rejects due to abort just return silently   try {     let logsPageQuery = "";-     // handle sql mode     if (!searchObj.meta.sqlMode) {       const queryBuild = buildSearch();       logsPageQuery = queryBuild?.query?.sql ?? "";     } else {       logsPageQuery = searchObj.data.query;     }-+    logsPageQuery = (logsPageQuery || "").trim();     // Check if query is SELECT * which is not supported for visualization     if (       store.state.zoConfig.quick_mode_enabled === true &&       isSimpleSelectAllQuery(logsPageQuery)
Suggestion importance[1-10]: 5

__

Why: TrimminglogsPageQuery beforeisSimpleSelectAllQuery can reduce edge-case mismatches, but importance is moderate and depends onisSimpleSelectAllQuery internals.

Low

Copy link
Contributor

@greptile-appsgreptile-appsbot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Summary

This PR fixes a UX issue where users briefly saw "No data found" messages when refreshing the logs page before the actual data was loaded. The fix properly sets the loading state (searchObj.loading = true) before callingloadLogsData() in thesetupLogsTab() function.

Key Changes:

  • AddedsearchObj.loading = true; beforeloadLogsData() call insetupLogsTab() function
  • Fixed the loading state management to prevent premature display of empty state messages
  • Minor code formatting improvements forq-icon elements and import statements

Impact:

  • Improved user experience by showing proper loading indicators during page refresh
  • Consistent with existing loading state patterns used throughout the component
  • No breaking changes or functional alterations to core logging functionality

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk as it only adds proper loading state management
  • Score reflects a straightforward UX improvement with minimal code changes. The fix follows existing patterns in the codebase and addresses a specific UI issue without introducing complexity or breaking changes
  • No files require special attention

Important Files Changed

File Analysis

Filename       Score       Overview
web/src/plugins/logs/Index.vue4/5Fixed loading state issue where "No data found" was briefly shown during page refresh by setting searchObj.loading = true before calling loadLogsData()

Sequence Diagram

sequenceDiagram    participant User    participant LogsPage as Logs Page Component    participant LoadLogsData as loadLogsData Function    participant API as Backend API    User->>LogsPage: Refreshes logs page    LogsPage->>LogsPage: setupLogsTab() called    Note over LogsPage: Before fix: loading state not set<br/>After fix: searchObj.loading = true    LogsPage->>LoadLogsData: loadLogsData()    LoadLogsData->>API: getStreamList()    LoadLogsData->>API: getFunctions()    LoadLogsData->>API: extractFields()    LoadLogsData->>API: getQueryData()    API-->>LoadLogsData: Return data    LoadLogsData->>LogsPage: refreshData()    Note over LogsPage: searchObj.loading = false<br/>Data displayed to user    LogsPage-->>User: Show logs data
Loading

No files reviewed, no comments

Edit Code Review Agent Settings |Greptile

@omkarK06omkarK06force-pushed thefix/logs-ui-no-data-found-on-refresh-main branch 2 times, most recently from3bcd8d3 to5e879f1CompareOctober 3, 2025 11:01
@omkarK06omkarK06force-pushed thefix/logs-ui-no-data-found-on-refresh-main branch from5e879f1 to9352545CompareOctober 31, 2025 11:33
@testdino-playwright-reporter

⚠️ Test Run Unstable


Author:omkarK06 | Branch:fix/logs-ui-no-data-found-on-refresh-main | Commit:9352545

Testdino Test Results

StatusTotalPassedFailedSkippedFlakyPass RateDuration
All tests passed376349021693%5m 31s

View Detailed Results

@omkarK06omkarK06 merged commit1d4a796 intomainOct 31, 2025
33 checks passed
@omkarK06omkarK06 deleted the fix/logs-ui-no-data-found-on-refresh-main branchOctober 31, 2025 13:22
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@bjp232004bjp232004bjp232004 approved these changes

+1 more reviewer

@greptile-appsgreptile-apps[bot]greptile-apps[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

☢️ BugSomething isn't workingReview effort 2/5

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@omkarK06@bjp232004

[8]ページ先頭

©2009-2025 Movatter.jp