Skip to content

Fix event subscription handle validation - #8848

Merged
isaacroldan merged 2 commits into
mainfrom
codex/fix-event-subscription-handles
Oct 9, 2026
Merged

isaacroldan merged 2 commits into
mainfrom
codex/fix-event-subscription-handles

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Event subscription handles use UI extension handle rules, which reject values such as orders_create, -orders, and orders-.

WHAT is this pull request doing?

Use a separate event subscription handle schema that accepts alphanumeric characters, underscores, and hyphens. Keep whitespace trimming, the 50-character limit, and rejection of empty handles and the reserved events handle. Update the acceptance and rejection tests.

Validation: 63 focused tests passed, including the event loader tests. TypeScript, changed-file ESLint, and git diff --check passed. Four new acceptance cases fail when the fix is removed.

How to manually test your changes?

  1. In an existing app, set a [[events.subscription]] handle in shopify.app.toml to orders_create.
  2. From this checkout, run pnpm shopify app build --path /path/to/app and confirm there is no handle validation error.
  3. Repeat with -orders and orders-.
  4. Set the handle to orders/create or events and confirm configuration validation fails.

Checklist

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

@isaacroldan
isaacroldan requested a review from a team as a code owner October 9, 2026 09:00
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Oct 9, 2026
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Oct 9, 2026
@gonzaloriestra

Copy link
Copy Markdown
Contributor

/snapit

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Built from 280eb71ef06d552aa657ea5736f5f7fe06200b14. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/[email protected]

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/private/node/json-error.d.ts
@@ -1,3 +1,16 @@
+interface FatalErrorLike {
+    type?: number;
+    message?: unknown;
+    formattedMessage?: unknown;
+    tryMessage?: unknown;
+    nextSteps?: unknown;
+    customSections?: unknown;
+    stack?: unknown;
+    command?: unknown;
+    args?: unknown;
+    details?: unknown;
+    code?: unknown;
+}
 /**
  * Writes the public JSON representation of a fatal error to stdout.
  *
@@ -6,4 +19,5 @@
  *
  * @param error - Fatal error to serialize.
  */
-export declare function renderFatalErrorAsJson(error: unknown): void;
\ No newline at end of file
+export declare function renderFatalErrorAsJson(error: FatalErrorLike): void;
+export {};
\ No newline at end of file

@gonzaloriestra gonzaloriestra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works as expeted 👌

@isaacroldan
isaacroldan added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit afcd045 Oct 9, 2026
30 checks passed
@isaacroldan
isaacroldan deleted the codex/fix-event-subscription-handles branch October 9, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants