Skip to content

Akhil/optimise backend v2 - #219

Merged
itsmeakhil merged 18 commits into
mainfrom
akhil/optimise-backend-v2
Jun 22, 2026
Merged

Akhil/optimise backend v2#219
itsmeakhil merged 18 commits into
mainfrom
akhil/optimise-backend-v2

Conversation

@itsmeakhil

Copy link
Copy Markdown
Collaborator

No description provided.

itsmeakhil and others added 18 commits June 22, 2026 09:47
Stores the Mongo user doc on request.state so multiple
Depends(get_current_user) in the same request resolve with
one Mongo find.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds coverage for the request.state cache invalidation guard
(cached doc with different _id must not be served) and explains
why FastAPI dependency_overrides is used over monkeypatch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Module-level Map<string, Promise> keyed by endpoint name; concurrent
callers share one Promise, entry is cleared in finally so the next
call re-runs the request.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- proxyJsonAuthed no longer pre-calls /auth/session/check
- /auth/session, /auth/refresh, /auth/session/check share in-flight
  Promises via auth-inflight dedupe helper
- establishBackendSession defaults check_revoked to false; only the
  initial login flow opts in to check_revoked=true
- proxyJsonAuthed try/catch around ensureBackendSession so persistent
  failures fall through to forceLogout instead of throwing
- move token/lastError inside establishBackendSession's dedupe callback
  to remove latent shared-closure capture
- restore informative comments in backendFetch around refresh paths
- document get_current_user's per-request memoization contract
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fix 1: Collapse repeated getToolUsageCounts() calls by memoizing the result once and deriving both topUsedTools and the KPI card value from the same memo.

Fix 2: Replace array index keys with stable segment label keys in donut arc circles for proper React reconciliation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@itsmeakhil
itsmeakhil merged commit e0af2c6 into main Jun 22, 2026
2 checks passed
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mydevtools-tech Ready Ready Preview, Comment Jun 22, 2026 8:07am

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