Skip to content

fix(schema): recheck external dispatch after resolving - #3705

Open
KayanoLiam wants to merge 1 commit into
feathersjs:dovefrom
KayanoLiam:fix-external-dispatch-cache
Open

KayanoLiam wants to merge 1 commit into
feathersjs:dovefrom
KayanoLiam:fix-external-dispatch-cache

Conversation

@KayanoLiam

Copy link
Copy Markdown

Summary

resolveExternal can encounter dispatch data created by a nested service call or a concurrent resolver after its initial cache check. Defining the same non-configurable dispatch property again then throws Cannot redefine property.

Check the cache again immediately before each item-level and result-level write, reusing dispatch data already produced while awaiting resolution. This covers repeated result objects and concurrent calls sharing the same array or paginated container.

Other Information

Added five service-level regressions, all failing with the reported TypeError on the original code. Tests also verify that filtered dispatch data is reused while the original service data remains intact.

npm test --workspace=@feathersjs/schema passes all 42 tests, including compilation and package checks. TypeScript, ESLint, Prettier, and diff checks pass for this change.

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.

Cannot redefine property: Symbol(@feathersjs/schema/dispatch)

1 participant