Repository navigation
fix(fb-marketing-messages): split node-only audience upload out of the router graph - #1569
Merged
Merged
Conversation
…e router graph The audience service added in #1550 mixed the read path (list, live status, delete) with file parsing and row hashing (node:stream, node:crypto). The builder's oRPC router imports the read path, and Next.js traces that router into the Edge instrumentation bundle, so the Node imports surfaced as "A Node.js module is loaded ... not supported in the Edge Runtime". - Move create/uploadMore and the parse + hash step into facebook-marketing-message-audience/upload.service.ts, exported only through the new `/upload` subpath and used by the server actions and public API - The statistics cache key hashes with the shared Web Crypto sha256Hex, since that read runs inside the router - Add a builder test that walks the edge instrumentation graph and fails on any Node built-in or process API the Edge runtime lacks - Document the split rule as AGENTS.md invariant 25 and in CLAUDE.md
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…e router graph (#1569)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Edge Runtime warnings caused by #1550 (fb-marketing-messages).
Cause: in #1550 the audience service used by the builder's router also imported the file parsing and hashing code (
node:stream,node:crypto). The router is traced into the Edge instrumentation bundle, so the builder logged "A Node.js module is loaded … not supported in the Edge Runtime".Fix: move the upload part (create / uploadMore, file parsing, hashing) into its own module,
@chatbotx.io/business/facebook-marketing-message-audience/upload, used only by the server actions and the public API. The statistics cache key now uses the sharedsha256Hex. A new test fails if Node-only code reaches the router again, and AGENTS.md invariant 25 documents the rule.