Repository navigation
Fix event subscription handle validation - #8848
Conversation
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Built from 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 |
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/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
left a comment
There was a problem hiding this comment.
Tested and it works as expeted 👌
WHY are these changes introduced?
Event subscription handles use UI extension handle rules, which reject values such as
orders_create,-orders, andorders-.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
eventshandle. Update the acceptance and rejection tests.Validation: 63 focused tests passed, including the event loader tests. TypeScript, changed-file ESLint, and
git diff --checkpassed. Four new acceptance cases fail when the fix is removed.How to manually test your changes?
[[events.subscription]]handle inshopify.app.tomltoorders_create.pnpm shopify app build --path /path/to/appand confirm there is no handle validation error.-ordersandorders-.orders/createoreventsand confirm configuration validation fails.Checklist