Skip to content

Conversation

@EmrysMyrddin
Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin commented Aug 16, 2025

The withState plugin utility was not respecting plugin properties with getters or setters.

In particular, properties with getters were just copied at plugin creating time, leading to potential bugs where the getter doesn't always return the same thing over time.

This PR fixes this by enumerating all properties with Object.getOwnPropertyDescriptors and iterating over it instead of Object.entries. This also allows to keep the enumerable, writable and configurable flags from each non-hooks properties.

See this PR for a usage of this: graphql-hive/gateway#1360

@github-actions
Copy link
Contributor

github-actions bot commented Aug 16, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@envelop/core 5.3.2-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 npm ↗︎ unpkg ↗︎
@envelop/parser-cache 9.0.1-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 npm ↗︎ unpkg ↗︎
@envelop/rate-limiter 8.1.0-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 npm ↗︎ unpkg ↗︎
@envelop/response-cache 8.0.2-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 npm ↗︎ unpkg ↗︎
@envelop/validation-cache 9.0.1-alpha-20250915143539-fd5e49440b71c59031c3455714d9baf604d1ae63 npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Aug 16, 2025

💻 Website Preview

The latest changes are available as preview in: https://87091d71.envelop.pages.dev

Copy link
Member

@ardatan ardatan left a comment

Choose a reason for hiding this comment

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

Do you think failing tests are related?

@EmrysMyrddin
Copy link
Collaborator Author

Weird, no I don't see how it could be linked :/ the test doesn't even use withState

@EmrysMyrddin
Copy link
Collaborator Author

@ardatan Test are passing again after a rebase :-)

@ardatan ardatan merged commit 92948d8 into main Sep 16, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants