Connection info#146
Conversation
Make IP Address, Connection Type & Loopback status available in the toolkit connection object
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 342b6c544f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| FrontendComponentRenderer, | ||
| FrontendComponentRenderers, | ||
| } from '@arcanejs/toolkit-frontend/types'; | ||
| import { ToolkitConnection } from '@arcanejs/toolkit'; |
There was a problem hiding this comment.
Replace root toolkit import in client simulator
This use client component imports ToolkitConnection from @arcanejs/toolkit root, which violates the /workspace/arcanejs/AGENTS.md rule for docs client code and can pull backend-only dependencies (like Node server modules) into the Next.js client bundle. In environments where that import is emitted, this causes client build/runtime failures; use a client-safe subpath or a type-only/local shape instead.
Useful? React with 👍 / 👎.
| const interfaces = os.networkInterfaces(); | ||
| for (const ifaceList of Object.values(interfaces)) { | ||
| for (const iface of ifaceList ?? []) { | ||
| if (iface.address === host) { |
There was a problem hiding this comment.
Normalize IPv4-mapped addresses before loopback check
The loopback detection compares remoteAddress to os.networkInterfaces() addresses with exact string equality, but dual-stack Node servers commonly report local IPv4 peers as mapped IPv6 (for example ::ffff:127.0.0.1), which will not match interface entries like 127.0.0.1. In that case isLoopback is incorrectly reported as false, so consumers of ToolkitConnection.isLoopback get wrong connection classification.
Useful? React with 👍 / 👎.
No description provided.