Skip to content

Read single-subscription events modules back into the TOML subscription list - #8357

Draft
dpeacock wants to merge 1 commit into
mainfrom
cx-events-readback-single-shape
Draft

Read single-subscription events modules back into the TOML subscription list#8357
dpeacock wants to merge 1 commit into
mainfrom
cx-events-readback-single-shape

Conversation

@dpeacock

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Core is migrating events app modules to a one-module-per-subscription structure (dual contract): each module's config carries events.subscription as a single object instead of a list, with the module uid derived from the subscription handle.

transformToEventsConfig assumes subscription is always a list and calls .map on it, so reading remote configuration (app config link, deploy config diffing) throws a TypeError once an app's stored modules use the new shape.

WHAT is this pull request doing?

  • Normalizes the remote events.subscription value to a list (object → one-element list) before stripping the server-managed identifier.
  • Multiple single-subscription modules then deep-merge back into one TOML [[events.subscription]] array through the existing remoteAppConfigurationExtensionContent union-array merge — the same mechanism webhook_subscription modules use today.
  • Legacy aggregate (list-shape) modules are unaffected; the TOML format does not change.

Known follow-up (out of scope): subscription ordering after merging N remote modules follows server module order, which may produce cosmetic diff noise in app config link output. Webhooks solves this with sort-on-parse (mergeAllWebhooks); events can adopt the same if it becomes a problem.

How to test your changes?

  • pnpm vitest run packages/app/src/cli/models/extensions/specifications/transform/app_config_events.test.ts (12 tests, includes single-object wrap + N-module merge)
  • Against a top-hat app whose events modules are stored single-shape (see Core PR): shopify app config link round-trips the TOML unchanged.

Measuring impact

  • n/a — bugfix/forward-compat for internal storage migration

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

…on list

Core is moving events modules to a one-module-per-subscription structure:
each module's config carries events.subscription as a single object instead
of a list. transformToEventsConfig assumed a list and called .map on it, so
reading remote configuration (app config link, deploy diffing) would throw
once an app's modules are stored in the new shape.

Normalize the subscription value to a list before stripping the
server-managed identifier. Multiple single-subscription modules then
deep-merge back into one TOML subscription array through the existing
remoteAppConfigurationExtensionContent union-array merge, exactly like
webhook_subscription modules do today. Legacy aggregate modules are
unaffected.

Assisted-By: devx/8f786480-3b9f-4b46-b2d1-8c99989471b2
@github-actions github-actions Bot added the Area: @shopify/app @shopify/app package issues label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/app @shopify/app package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant