Skip to content

fix(pm-console): the edge could not make a request of its own: no notification it sent ever left - #12954

Merged
dezren39 merged 1 commit into
mainfrom
claude/pm-edge-fetch
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
claude/pm-edge-fetch

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

No notification the edge has sent ever left it. Nor did it ever read the Android release from GitHub. Both failed the same way, silently, since the edge first went in front of the site (b7b881d, 2026-11-22 11:14Z).

What was wrong

In the Worker runtime the platform's fetch refuses to be called as a method of another object. this.fetchImpl(url), with the global fetch kept in fetchImpl, throws:

TypeError: Illegal invocation: function called with incorrect `this` reference.

bun and Node do not mind, so every test passed. The edge kept the global fetch on itself and called it exactly that way:

Where What it broke
the sender of notifications every notification from the edge: a reply from the fleet, something that needs the owner, a unit that keeps failing, the laptop gone quiet. The failure was caught, counted, and shown nowhere
the Android release the edge never knew of a release; a download always fell back to the laptop's copy
the laptop's own classes, run at the edge every read and write of the queue store in direct mode, had it been switched on

How it was found

Health had just been made to say which release the edge knows of (#12946). On the deployed Worker it said none, while the release was plainly published. Reproduced in the runtime itself: called as a method, fetch throws; called plainly, it works.

The fix, and why it cannot come back quietly

  • No class keeps a fetch it was given: each keeps a plain caller (src/plain.ts).
  • The tests can now see it. The stand-in fetch handed to the edge, to direct mode and to Ops refuses to be called as a method, as the runtime's does. With the code as it was, 21 tests fail on it (the release, the notifications, direct mode); with the fix they pass.
  • The deploy checks it in the real runtime. The run of the bundle in the Worker runtime now checks that the state can make a request of its own. Run here with the fix, it reads the real release from GitHub (2026.11.23-0f311ae); with the fix taken out it fails, quoting the runtime.
  • Health says why the release could not be read (androidReleaseTrouble), so "none published" and "could not ask" no longer look the same from outside.

Checked

bun test 194 pass; five planted faults each caught (a sixth was in a line that turned out to be redundant, which is removed); the real-runtime run passes with the fix and fails without it.

Not checked

A notification leaving the deployed Worker: that needs a subscribed device. What I check after the deploy is that the deployed Worker now reads the release, which is the same fetch.


Generated by Claude Code


Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…ification it sent ever left

In the Worker runtime the platform's fetch refuses to be called as a
method of another object: `this.fetchImpl(url)`, with the global fetch
kept in `fetchImpl`, throws "TypeError: Illegal invocation". bun and
Node do not mind, so every test passed. The edge kept the global fetch
on itself and called it exactly that way, in three places:

- the sender of notifications: every notification the edge has tried to
  send since it went in front of the site failed before leaving (a
  reply from the fleet, something that needs the owner, a unit that
  keeps failing, the laptop gone quiet). The failure was caught and
  counted, and nothing showed it;
- reading the Android release from GitHub, and fetching its file: the
  edge never knew of a release, so a download always fell back to the
  laptop's copy;
- and, through the laptop's own classes run at the edge, every read and
  write of the queue store in direct mode, had it been switched on.

Found from outside: health had just been made to say which release the
edge knows of, and on the deployed Worker it said none while the
release was plainly there. Reproduced in the runtime itself: called as
a method, fetch throws; called plainly, it works.

- No class keeps a fetch it was given: each keeps a plain caller
  (src/plain.ts). Edge, Ops (which Work reaches through) and the
  laptop's link all do.
- The tests could not see this, so they are made able to: the stand-in
  fetch handed to the edge, to direct mode and to Ops now refuses to be
  called as a method, as the runtime's does (asThePlatformFetch). With
  the code as it was, 21 tests fail on it: the release, the
  notifications, direct mode. They pass with the fix.
- Health says why the release could not be read
  (androidReleaseTrouble), so "none published" and "could not ask" no
  longer look the same from outside.
- The deploy's run of the bundle in the Worker runtime checks that the
  state can make a request of its own. Run here with the fix it reads
  the real release from GitHub (2026.11.23-0f311ae); with the fix taken
  out it fails with the runtime's own words.

Not checked: a notification leaving the deployed Worker. That needs a
subscribed device; what is checked after deploy is that the deployed
Worker now reads the release, which is the same fetch.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 05:52
@dezren39
dezren39 merged commit ca5c044 into main Nov 23, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fa1c8782-3e44-49f8-9a8c-c6812ac3a294
Commits

Reviewing files that changed from the base of the PR and between 307dc8a and bff0a57.

Files selected for processing: 10

  • pm-stack/console/edge/README.md
  • pm-stack/console/edge/src/edge.ts
  • pm-stack/console/scripts/edge-smoke.ts
  • pm-stack/console/src/ops.ts
  • pm-stack/console/src/plain.ts
  • pm-stack/console/src/sync.ts
  • pm-stack/console/test/direct.test.ts
  • pm-stack/console/test/edge.test.ts
  • pm-stack/console/test/support.ts
  • pm-stack/console/test/work.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@dezren39
dezren39 deleted the claude/pm-edge-fetch branch November 23, 2026 05:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T05:54:20.494488Z bff0a57 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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