Skip to content

fix(ourlogs): fetch pinned logs with a single events request - #119268

Merged
JoshuaKGoldberg merged 1 commit into
masterfrom
joshgoldberg/logs-905-use-events-endpoint-in-frontend
Jul 9, 2026
Merged

fix(ourlogs): fetch pinned logs with a single events request#119268
JoshuaKGoldberg merged 1 commit into
masterfrom
joshgoldberg/logs-905-use-events-endpoint-in-frontend

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Jul 8, 2026

Copy link
Copy Markdown
Member

Before this, pinned logs not already in the table were fetched in two steps using the general-purpose fetcher:

  1. Over the selected time range
  2. Escalating any out-of-range ids to a wider window.

But as determined this week, we can actually use the events endpoint. Which is Guaranteed ™️ with sampling=HIGHEST_ACCURACY to give the logs (if they exist)! This collapses that into one events request windowed directly to the pins' own UUIDv7 timestamps.

Marking as a fix rather than a ref because it improves performance in the cases that needed to run the two requests.

Closes LOGS-905.

Collapse the two-step pinned-log fetch (selected range, then escalate
out-of-range ids to a wider window) into one events request windowed to the
pins' own UUIDv7 timestamps. HIGHEST_ACCURACY already guarantees no rows are
dropped regardless of window width, so the id-derived window is now purely a
perf optimization to keep the scan small. The per-id request batching and cache
are unchanged, so unpinning one of several pins still serves the rest from
cache without a refetch.

Refs LOGS-905
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 8, 2026

Copy link
Copy Markdown

LOGS-905

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 8, 2026
@JoshuaKGoldberg

Copy link
Copy Markdown
Member Author

@cursor review

@JoshuaKGoldberg JoshuaKGoldberg changed the title ref(ourlogs): Fetch pinned logs with a single events request fix(ourlogs): fetch pinned logs with a single events request Jul 8, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit ac5cfe6. Configure here.

@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review July 8, 2026 21:38
@JoshuaKGoldberg
JoshuaKGoldberg requested a review from a team as a code owner July 8, 2026 21:38
@JoshuaKGoldberg
JoshuaKGoldberg requested a review from k-fish July 8, 2026 21:38
Comment thread static/app/views/explore/logs/pinning/usePinnedLogsQuery.tsx
@JoshuaKGoldberg
JoshuaKGoldberg merged commit 70f6644 into master Jul 9, 2026
78 checks passed
@JoshuaKGoldberg
JoshuaKGoldberg deleted the joshgoldberg/logs-905-use-events-endpoint-in-frontend branch July 9, 2026 15:41
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.

3 participants