Skip to content

Prefetch timeline, queue, and approvals with thread bootstrap - #2935

Open
Guitaraholic wants to merge 1 commit into
get-bb:mainfrom
Guitaraholic:fix/thread-open-prefetch
Open

Prefetch timeline, queue, and approvals with thread bootstrap#2935
Guitaraholic wants to merge 1 commit into
get-bb:mainfrom
Guitaraholic:fix/thread-open-prefetch

Conversation

@Guitaraholic

Copy link
Copy Markdown

Human comments

What was wrong

Opening a thread waited for GET /threads/:id?include=environment,host to settle before starting timeline, queued messages, and pending interactions. That serial waterfall is the request-cost half of #1303. Git work-status and pull-request reads still need environment, so they stay after bootstrap.

What changed

  • useThreadDetailBootstrap always starts timeline, queued-message, and pending-interaction reads in the same turn as the bootstrap GET.
  • Removed the optional timelinePrefetch flag. AppLayout no longer has to opt in; ThreadDetailView gets the same prefetch.
  • Not a GET /threads/:id/open payload. Wire shape is unchanged.

How you verified

  • apps/app/src/hooks/queries/thread-queries.test.tsx now asserts timeline, queued messages, and pending interactions are requested before bootstrap settles.
  • Ran that file with vitest: 22 passed.

Fixes #1303

AGENT GENERATED

Opening a thread waited for GET /threads/:id before starting the
payloads the view needs next. Start those reads in the same turn so
React Query joins in-flight work instead of a second serial round.

Fixes get-bb#1303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening a thread fires ~19 API requests, including per-open environment git probes

1 participant