Skip to content

fix: resolve in-page channel functions across chained registries - #378

Merged
antfu merged 1 commit into
mainfrom
fix/in-page-channel-ci
Sep 10, 2026
Merged

fix: resolve in-page channel functions across chained registries#378
antfu merged 1 commit into
mainfrom
fix/in-page-channel-ci

Conversation

@antfubot

@antfubot antfubot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Intent

CI on main is red: the in-page-channel unit suite fails 17 tests and the a11y hub-static e2e specs fail, because #371 ("separate in-page channel events from functions") introduced two regressions in the endpoint's local function table.

  1. The DF0077 "not registered" fallback was returned per-registry: any unknown function:-prefixed name made a registry hand back a throwing handler. Both endpoints resolve with stateRegistry.resolve(name) ?? registry.resolve(name), so the first registry's throwing handler short-circuited the ?? and the real user registry was never consulted — every user call threw "function … is not registered".

  2. channelMethod wrapping was applied at registration time to the shared-state handlers too, but those handlers are keyed by their own fully-qualified wire methods (devframe:in-page:page-state:* and the panel-state events). Double-prefixing them meant no state request or notification ever resolved, hanging every shared-state test and the a11y panel's scan.

Change

  • Move the DF0077 fallback out of each registry into a resolveLocalHandler seam that runs after every registry, so chaining never masks a real handler.
  • Register the shared-state handlers verbatim via a new registerInternal, bypassing channelMethod.

Full local run green: lint, knip, test (1515 pass), typecheck, build, and the previously-failing a11y-messages-hub-static e2e (4 pass).

This PR was created with the help of an agent.

The DF0077 "not registered" fallback and the channelMethod wrapping
introduced in #371 broke every user call and all shared-state traffic:
the per-name fallback made a registry return a throwing handler for any
unknown function name, so chaining `stateRegistry.resolve ?? registry.resolve`
short-circuited before the real registry was consulted, and the state
layer's already-namespaced handlers got double-prefixed by channelMethod.

Move the fallback into a resolveLocalHandler seam that runs after every
registry, and register the shared-state handlers verbatim.
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 9, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +0 new · 🟠 ~1 changed · 🔴 -0 removed · 1 flow · 3 files · commit 917d30f


Architecture

Architecture diagram for devframes/devframe at 917d30f

1 component touched across 2 lanes.

Open the interactive canvas


Data flow

Data flow diagram for devframes/devframe at 917d30f

Resolving in-page channel function calls

Open the interactive canvas


Drill down
Client Runtimes & UI — 1 component
🟡 CHANGED In-Page Channel Bridge

Facilitates communication and shared state sync between page scripts and panel endpoints.


View

  • Architecture lens
  • Data flow lens
  • Expand every detail
  • Show unchanged neighbours

Tip

Push a new commit and the whole comment re-renders for the new head. An older run never overwrites a newer one, so a slow render cannot put a stale diagram back.

🪧 More tips
  • Run PR Lens on your own machine: npx skills add coldteadotai/pr-lens installs the agent skill. Then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Draw a diff before it is even a pull request: npx @coldtea/pr-lens-cli analyze --base origin/main reads the diff with your own model key, and npx @coldtea/pr-lens-cli render .pr-lens/graph.json draws the same lenses on your machine.
  • The boxes under View are live. Tick Architecture lens or Data flow lens to choose which diagrams appear, or Expand every detail to open every drill-down at once. The comment redraws in place a few seconds later.
  • Show unchanged neighbours lists the components this change did not touch alongside the ones it did, so the drill-down shows what the changed code sits next to.
  • GitHub will not let you zoom an image in a comment. The link under each diagram opens it on an interactive canvas, where you can zoom, pan and step through the flow.
  • The CLI's render picks up .github/pr-lens.yml automatically and applies your corrections (renames, exclusions, lane pins) at draw time.
  • Would you rather run it from CI on a key of your own? Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and a model key in your repository secrets, say GEMINI_API_KEY. The Action asks Gemini by default, or OpenAI and any endpoint speaking /chat/completions through its provider input.
  • PR Lens is free for open source. A star on the repository is what keeps it going.
  • The diagrams follow your GitHub theme, so dark mode gets the dark render and light mode the light one, and the moving dots show this pull request's data in motion.

◈ Rendered by PR Lens · crafted with ❤️ by the Coldtea team · Come say hi on Discord

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
devframe Skipped Skipped Sep 9, 2026 11:55pm UTC

@antfu
antfu merged commit b0683e7 into main Sep 10, 2026
14 checks passed
@antfu
antfu deleted the fix/in-page-channel-ci branch September 10, 2026 00:14
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.

2 participants