⚡ Bolt: Add module-level caching for BlogApp#99
Conversation
- Adds `fetchPromise` cache to `BlogApp.tsx` to deduplicate multiple requests on multiple mount instances (e.g. multi-windows in OS shell) - Adds `signal: AbortSignal.timeout(10000)` to `fetch` calls in `BlogApp.tsx`, `useProjects.ts`, and `github.ts` to prevent UI hangs or DoS - Ensures caching properly resets on error so retries can occur Co-authored-by: schmug <38227427+schmug@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Superseded by #127 (merged to main), which consolidated the best of the duplicate Bolt/Sentinel/Palette scheduled-agent PRs into one reviewed change. Closing as duplicate. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
💡 What:
/api/blog.jsoninBlogApp.tsx.AbortSignal.timeout(10000)tofetchrequests acrossBlogApp.tsx,useProjects.ts, andgithub.ts.🎯 Why:
When the user opens multiple instances of
BlogApp(or remounts it quickly via window manager), React triggers duplicate network requests for the same semi-static data payload. Caching the Promise globally deduplicates these requests. Additionally, unboundfetchcalls leave the React application vulnerable to indefinite hangs if the network is flaky.📊 Impact:
/api/blog.jsonpayload network requests by 100% on subsequent remounts or simultaneous renders.🔬 Measurement:
Open the application in dev mode, open the network tab, and rapidly open 5 instances of the Blog app via the taskbar. Previously, this would trigger 5 identical
fetchrequests. Now, it will only trigger 1 request. Additionally, artificially delaying the API response beyond 10s will now reliably trigger the fallback error UI rather than hanging indefinitely.PR created automatically by Jules for task 11360143037787946840 started by @schmug