-
Notifications
You must be signed in to change notification settings - Fork 133
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix(ui): Fix statement list initial loading #846
Conversation
@@ -213,7 +217,6 @@ export default function useStatementTableController( | |||
} | |||
|
|||
if (allTimeRanges.length === 0) { | |||
setLoadingStatements(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be useless statement update when queryStatementList start.
@@ -112,7 +112,7 @@ export default function useStatementTableController( | |||
[queryOptions, allTimeRanges] | |||
) | |||
|
|||
const [loadingStatements, setLoadingStatements] = useState(false) | |||
const [loadingStatements, setLoadingStatements] = useState(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember it was true
before then I modified it to false
, you can see the commit history to understand why it was changed. Maybe I was wrong, just for double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll check it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used in combination with cache item. Wow, almost made a mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I think the semantics of the previous code is not clear enough and may cause bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will have a test when I am free.
@@ -209,11 +213,11 @@ export default function useStatementTableController( | |||
const cacheItem = cacheMgr?.get(cacheKey) | |||
if (cacheItem) { | |||
setStatements(cacheItem) | |||
setLoadingStatements(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix by this line.
I will test it today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
* use cache for slow query and statements (#828) * Optimize slow-query list (#835) * keyviz: fix the bug that table info cannot be obtained if the database name contains special chars (#840) * ui: remember the coarse scrolled position for statements and slow queries list (#843) * ui: refine page change statistics (#839) * fix slow query bug when order by other fields (#838) * config: fix the bug that the dynamic config cannot be obtained when the PD starts later than the dashboard server (#842) * Add placeholders for using scaffold (#844) * ui: add more shared session expired duration options (#849) * Fix(ui): Fix statemtent list initial loading (#846) * Update github.com/oleiade/reflections to v1.0.1 to avoid checksum mismatch (#850) * update package name (#857) * keyviz: support obtaining table info with clustered index from tidb (#845)
close #829