Skip to content

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

Merged
daffl merged 1 commit into
feathersjs:dovefrom
akasakariko:fix-external-dispatch-cache
Sep 24, 2026
Merged

daffl merged 1 commit into
feathersjs:dovefrom
akasakariko:fix-external-dispatch-cache

Conversation

@akasakariko

Copy link
Copy Markdown
Contributor

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.

@daffl
daffl merged commit 572574e into feathersjs:dove Sep 24, 2026
2 of 4 checks passed
@daffl

daffl commented Sep 24, 2026

Copy link
Copy Markdown
Member

This looks good, thank you for getting that in! It will go out with the next release!

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)

2 participants