fix: prevent infinite RPC reconnection loop and respect app.baseURL in devtools#278
fix: prevent infinite RPC reconnection loop and respect app.baseURL in devtools#278
Conversation
…n devtools Closes #243 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughAdds a module-scoped Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/devtools.ts (1)
8-8: Consider declaringufoas a direct dependency for clarity.The import
joinURLfromufoworks becauseufois a transitive dependency of@nuxt/kit(which is already a direct dependency). However, for better maintainability, explicitly declareufoinpackage.json's dependencies to avoid relying on transitive dependency stability.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/devtools.ts` at line 8, The import of joinURL in src/devtools.ts comes from a transitive dependency (ufo via `@nuxt/kit`); add "ufo" to package.json dependencies to make it a direct dependency and avoid relying on transitive stability. Update package.json by adding the appropriate ufo version (match the version used by `@nuxt/kit` or bump to a compatible one), run npm/yarn install, and then verify src/devtools.ts still imports joinURL successfully.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@client/app/composables/rpc.ts`:
- Around line 71-78: The guard variable hasConnected is being set before the
awaited handshake call nuxtA11yRpc.value!.connected(), so if connected() throws
the flag prevents retries; move the assignment of hasConnected = true so it only
runs after await nuxtA11yRpc.value!.connected() completes successfully (i.e.,
perform the await inside the try, and set hasConnected = true after the awaited
call), leaving the catch to handle errors without flipping the guard.
---
Nitpick comments:
In `@src/devtools.ts`:
- Line 8: The import of joinURL in src/devtools.ts comes from a transitive
dependency (ufo via `@nuxt/kit`); add "ufo" to package.json dependencies to make
it a direct dependency and avoid relying on transitive stability. Update
package.json by adding the appropriate ufo version (match the version used by
`@nuxt/kit` or bump to a compatible one), run npm/yarn install, and then verify
src/devtools.ts still imports joinURL successfully.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3d558cd0-c7ce-43f9-b962-d1379f5cdeee
📒 Files selected for processing (2)
client/app/composables/rpc.tssrc/devtools.ts
commit: |
Summary
Fixes #243
hasConnectedguard inclient/app/composables/rpc.tsso the initialconnected()RPC call only fires once, preventing repeated scan triggers when the devtools iframe reconnects behind a reverse proxyjoinURL(nuxt.options.app.baseURL, DEVTOOLS_UI_ROUTE)insrc/devtools.tsso the custom devtools tab iframe respectsapp.baseURL, matching the fix applied in@nuxt/fonts(nuxt/fonts#395)