Skip to content

feat(logs): Add pause functionality to auto-refresh #96698

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

Merged
merged 4 commits into from
Jul 30, 2025

Conversation

k-fish
Copy link
Member

@k-fish k-fish commented Jul 29, 2025

Summary

  • Add pausedAt timestamp tracking in context using ref
  • Update useSetLogsAutoRefresh to handle 'pause' state
  • Change toggle and row expansion to use 'pause' instead of 'idle'
  • Make useVirtualStreaming jump to pausedAt timestamp when re-enabling
  • Fixes analytics firing multiple times because of .length attribute on the useEffect
  • fixes prefetching firing too much if you hover rows and autorefresh is on.

- Add pausedAt timestamp tracking in context using ref
- Update useSetLogsAutoRefresh to handle 'pause' state
- Change toggle and row expansion to use 'pause' instead of 'idle'
- Make useVirtualStreaming jump to pausedAt timestamp when re-enabling
- Fixes analytics firing multiple times because of .length attribute on
  the useEffect
- fixes prefetching firing too much if you hover rows and autorefresh is
  on.
@k-fish k-fish requested a review from a team as a code owner July 29, 2025 21:27
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 29, 2025
Copy link

codecov bot commented Jul 29, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
11087 1 11086 10
View the top 1 failed test(s) by shortest run time
LogsPage pauses auto-refresh when row is clicked
Stack Traces | 1.87s run time
Error: Expected test not to call console.error().

If the error is expected, test for it explicitly by mocking it out using jest.spyOn(console, 'error').mockImplementation() and test that the warning occurs.



Error: No mocked response found for request: GET .../trace-items/1/
    at processTimers (node:internal/timers:523:7)
    at console.captureMessage [as error] (.../sentry/node_modules/.pnpm/jest-fail-on-console@3.3..../node_modules/jest-fail-on-console/index.js:83:25)
    at Object.error (.../app/__mocks__/api.tsx:78:15)
    at Promise.finally.completed (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:1559:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:1499:10)
    at _callCircusHook (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:978:40)
    at _runTest (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:951:5)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:839:13)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:829:11)
    at run (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:757:3)
    at runAndTransformResultsToJestFormat (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:1920:21)
    at jestAdapter (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/runner.js:101:19)
    at runTestInternal (.../sentry/node_modules/.pnpm/jest-runner@30.0..../jest-runner/build/testWorker.js:272:16)
    at runTest (.../sentry/node_modules/.pnpm/jest-runner@30.0..../jest-runner/build/testWorker.js:340:7)
    at Object.worker (.../sentry/node_modules/.pnpm/jest-runner@30.0..../jest-runner/build/testWorker.js:494:12)
    at flushUnexpectedConsoleCalls (.../sentry/node_modules/.pnpm/jest-fail-on-console@3.3..../node_modules/jest-fail-on-console/index.js:48:13)
    at Object.<anonymous> (.../sentry/node_modules/.pnpm/jest-fail-on-console@3.3..../node_modules/jest-fail-on-console/index.js:145:7)
    at Promise.finally.completed (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:1559:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:1499:10)
    at _callCircusHook (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:978:40)
    at _runTest (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:951:5)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:839:13)
    at _runTestsForDescribeBlock (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:829:11)
    at run (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:757:3)
    at runAndTransformResultsToJestFormat (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/jestAdapterInit.js:1920:21)
    at jestAdapter (.../sentry/node_modules/.pnpm/jest-circus@30.0.4_babel-plugin-macros@3.1..../jest-circus/build/runner.js:101:19)
    at runTestInternal (.../sentry/node_modules/.pnpm/jest-runner@30.0..../jest-runner/build/testWorker.js:272:16)
    at runTest (.../sentry/node_modules/.pnpm/jest-runner@30.0..../jest-runner/build/testWorker.js:340:7)
    at Object.worker (.../sentry/node_modules/.pnpm/jest-runner@30.0..../jest-runner/build/testWorker.js:494:12)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

cursor[bot]

This comment was marked as outdated.

@k-fish k-fish enabled auto-merge (squash) July 30, 2025 14:28
@k-fish k-fish merged commit 6c5430e into master Jul 30, 2025
45 checks passed
@k-fish k-fish deleted the fix/ourlogs/virtual-timestamp-stale branch July 30, 2025 14:39
Copy link

sentry-io bot commented Jul 30, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

andrewshie-sentry pushed a commit that referenced this pull request Aug 4, 2025
### Summary
- Add pausedAt timestamp tracking in context using ref
- Update useSetLogsAutoRefresh to handle 'pause' state
- Change toggle and row expansion to use 'pause' instead of 'idle'
- Make useVirtualStreaming jump to pausedAt timestamp when re-enabling
- Fixes analytics firing multiple times because of .length attribute on
the useEffect
- fixes prefetching firing too much if you hover rows and autorefresh is
on.

---------

Co-authored-by: Tony Xiao <txiao@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants