Skip to content

perf: skip 3s DWN discovery for returning users and parallelize registration#78

Open
LiranCohen wants to merge 1 commit into
mainfrom
perf/startup-optimizations
Open

perf: skip 3s DWN discovery for returning users and parallelize registration#78
LiranCohen wants to merge 1 commit into
mainfrom
perf/startup-optimizations

Conversation

@LiranCohen

@LiranCohen LiranCohen commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Rebased on current main and re-applied the still-valid startup improvements in the current Effect-based code.

Changes

  • Skip local-DWN discovery during provider initialization when a same-tab vault password is already cached.
  • Keep the current discovery helper behavior that resolves early when an endpoint appears.
  • Parallelize DWN registration while preserving current network policy retries and injected registration-token storage.
  • Prepare provider-auth tokens once per endpoint, then register all agent/identity DIDs concurrently.
  • Add provider tests for cached-session discovery skip and fresh-session discovery.

Verification

  • pnpm vitest run src/enbox/__tests__/provider.test.tsx src/enbox/__tests__/registration.test.ts
  • pnpm lint (passes with existing Testing Library warnings)
  • pnpm build
  • pnpm test

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 58.42% (🎯 25%) 2260 / 3868
🔵 Statements 56.33% (🎯 25%) 2387 / 4237
🔵 Functions 58.09% (🎯 30%) 804 / 1384
🔵 Branches 53.55% (🎯 29%) 1364 / 2547
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/enbox/provider.tsx 67.27% 54% 72.41% 70.06% 90, 138, 153-166, 191, 196, 200, 206, 211, 221, 244-246, 255-279, 291, 309-311, 320-335, 344, 349-350
src/enbox/registration.ts 64.44% 51.61% 65.3% 65.9% 59, 64, 69-134, 158, 168-172, 209, 242, 252, 319-321, 344-345
Generated in workflow #350 for commit 299b66a by the Vitest Coverage Report Action

@LiranCohen
LiranCohen force-pushed the perf/startup-optimizations branch from 63c2365 to 29514b0 Compare June 23, 2026 14:16
@LiranCohen
LiranCohen force-pushed the perf/startup-optimizations branch from 29514b0 to 299b66a Compare June 23, 2026 14:20
@LiranCohen

Copy link
Copy Markdown
Contributor Author

Triage (2026-07-07): keeping this open — it's the only survivor of the stale-PR sweep. Branch was rebuilt on the Effect-based code on 2026-06-23, is currently MERGEABLE/CLEAN against main, and CI is green on the refreshed head. Premise (skip local-DWN discovery for returning users, parallelize registration) is startup-perf work orthogonal to the connect flow changes. Needs a review pass before merge — it hasn't had one since the rebuild.

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.

1 participant