You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Four targeted optimizations based on investigation showing Bun already
uses HTTP/2 multiplexing and keep-alive (transport is not the
bottleneck), but sequential resolution chains and unbounded fan-outs
cause observable slowness.
## Changes
### 1. HTTP timing diagnostics (`sentry-client.ts`)
Debug-level logging in the authenticated fetch showing method, URL path,
status, timing (ms), cache hits, and retry attempts. Visible with
`SENTRY_LOG_LEVEL=debug` or `--verbose`.
### 2. Post-login cache warming (`auth/login.ts`)
After successful login, fire-and-forget `listOrganizationsUncached()` to
pre-populate the org + region SQLite cache, eliminating the ~800ms
cold-start on the first command.
### 3. Concurrency limits on org fan-outs
Add `p-limit(5)` to all unbounded `Promise.all()` patterns that fan out
across organizations or regions:
- `findProjectsBySlug()`, `findProjectsByPattern()`,
`findProjectByDsnKey()` in `api/projects.ts`
- `findEventAcrossOrgs()` in `api/events.ts`
- `resolveProjectSearch()` in `commands/issue/utils.ts`
### 4. Faster org resolution for normal slugs (`region.ts`)
`resolveEffectiveOrg()` now uses `resolveOrgRegion()` (1 API call) for
normal slugs instead of `listOrganizationsUncached()` (1+N requests).
The expensive fan-out is reserved for DSN numeric IDs (`oNNNNN`) that
need ID→slug mapping.
## Test plan
- `bun run typecheck` — clean
- `bun run lint` — clean
- 293 tests across affected modules pass
0 commit comments