Repository navigation
Conversation
The HTTP Analytics and HTTP Request Logs pages queried the last 7 days as soon as they opened. On busy instances that query can take long enough to make the server unresponsive. Both pages now wait until a time range is picked or Refresh is clicked. Fixes fosrl#4096
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
AI Disclosure
This change was prepared with AI assistance (Claude Code): code and description. It was reviewed before submission.
Description
Fixes #4096.
Both HTTP Requests pages (Analytics > HTTP Requests and Logs > HTTP Requests) queried the last 7 days as soon as they opened. On a busy instance that query can run long enough to make the whole server unresponsive, and there was no way to narrow the range before it started.
The pages now open without fetching anything. The date pickers still show the last 7 days, and a message asks the user to choose a time range or click Refresh to load the range shown. Picking a start or end date, or clicking Refresh, loads the data as before. A page opened with a range already in the URL loads straight away, so existing links and the filter state in the URL behave as they did.
Changes:
LogAnalyticsData: the analytics query isenabledonly once the URL hastimeStart/timeEndor Refresh was clicked. Until then the chart shows the same blurred placeholder it uses while loading, with the new message in place of the spinner.logs/request/page.tsx: the request log query isenabledonly once a range was picked, Refresh was clicked, or the URL hasstartandend.LogDataTable: new optionalemptyMessageprop, used for the prompt above. Other log pages are unchanged.messages/en-US.json: one new key,logsSelectTimeRange.Screenshots
Notes for reviewers:
queryUniqueFilterAttributesinqueryRequestAuditLog.tsstill runs six distinct scans over the chosen range.How to test?
/logs/analyticsis made, and the chart shows "Choose a time range, or click Refresh to load the last 7 days."/logs/requestis made and the table shows the same message.?timeStart=...&timeEnd=...on analytics,?start=...&end=...on the request logs). It loads immediately, as before.Checked locally on the SQLite OSS build with 1,500 seeded request log rows, counting API calls in a headless browser. Before the change each page made one logs API call on open. After it, zero on open and one after Refresh.
npx tsc --noEmitpasses under bothset:ossandset:enterprise,npm testpasses (19/19 files),npx next buildsucceeds, and Prettier is clean on the changed files.