-
Notifications
You must be signed in to change notification settings - Fork 715
fix: pagination part fix #4096
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: pagination part fix #4096
Conversation
WalkthroughThe recent modifications to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Pagination
participant QueryHandler
participant Logger
User->>Pagination: Request next page
Pagination->>QueryHandler: Update start_time and end_time
QueryHandler->>Logger: Fetch query results with updated time
Logger-->>QueryHandler: Return query results
QueryHandler-->>Pagination: Display updated results
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/src/composables/useLogs.ts (4 hunks)
Additional comments not posted (5)
web/src/composables/useLogs.ts (5)
800-800: EnsuresearchObj.data.queryResults.hitsis correctly handled.Setting
searchObj.data.queryResults.hitsto an empty array before updatingreq.query.sqlensures that previous query results do not interfere with the new query. This is a good practice to maintain data consistency.
1198-1199: Verify the initialization ofsearchObj.data.queryResults.total.Setting
searchObj.data.queryResults.totalto0ensures that the total count is reset before processing new partitions. This helps avoid inaccuracies in the total count.
2247-2254: Ensure correct handling ofstart_timeandend_timefor pagination.Setting
queryReq.query.start_timeandqueryReq.query.end_timebased on the current pagination state ensures that the histogram data is accurately retrieved for the correct time range.
2251-2254: Ensure correct handling ofstart_timeandend_timefor pagination ingetQueryData.Updating
queryReq.query.start_timeandqueryReq.query.end_timebased on the current pagination state ensures that the query data is accurately retrieved for the correct time range.
2251-2254: Ensure correct handling ofstart_timeandend_timefor pagination ingetPaginatedData.Updating
queryReq.query.start_timeandqueryReq.query.end_timebased on the current pagination state ensures that the paginated data is accurately retrieved for the correct time range.
|
Need to test it with huge data that onmounted I am appending the start time and end time so is it correct or not |
dbbaeb6 to
489aa68
Compare
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/src/composables/useLogs.ts (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- web/src/composables/useLogs.ts
489aa68 to
a75a223
Compare
a75a223 to
7910722
Compare
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/src/composables/useLogs.ts (4 hunks)
Additional comments not posted (2)
web/src/composables/useLogs.ts (2)
2379-2386: LGTM! Verify the dynamic assignment of time parameters.The code changes are approved.
However, ensure that the dynamic assignment of
start_timeandend_timefor the query request works correctly in all scenarios.Verification successful
Let's re-run the search for
queryReq.query.start_timeandqueryReq.query.end_timewithout specifying the file type.
The dynamic assignment of
start_timeandend_timefor the query request appears to be correctly implemented.The assignments are consistent across different parts of the codebase, and no issues were found with the current implementation.
web/src/composables/useLogs.tsweb/src/plugins/traces/Index.vueScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the dynamic assignment of `start_time` and `end_time` for the query request. # Test: Search for the usage of `queryReq.query.start_time` and `queryReq.query.end_time` in the codebase. Expect: Ensure that the dynamic assignment works correctly in all scenarios. rg --type javascript -A 5 $'queryReq.query.start_time'Length of output: 88
Script:
#!/bin/bash # Description: Verify the dynamic assignment of `start_time` and `end_time` for the query request. # Test: Search for the usage of `queryReq.query.start_time` and `queryReq.query.end_time` in the codebase. Expect: Ensure that the dynamic assignment works correctly in all scenarios. rg -A 5 'queryReq.query.start_time'Length of output: 5325
1213-1214: Ensure total count logic is correct.Setting
searchObj.data.queryResults.totalto0might impact the total count logic. Verify that this change does not cause issues with the total count calculation elsewhere in the code.
1. Logs count fix when moving back and forth (this was the issue that came up when I have fixed the different logs count showing at first ) 2. Fixed another issue that onMount in histogram mode when we move to any other page and comeback to first page it shows 0 total count. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced handling of query results for improved accuracy in data representation. - Introduced dynamic time parameters for queries based on pagination, optimizing data retrieval. - **Bug Fixes** - Addressed potential discrepancies in the total count of query results. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Bug Fixes