Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From Discord: Issue with S.omit not removing fields from schema #4603

Closed
effect-bot opened this issue Mar 14, 2025 · 0 comments · Fixed by #4588
Closed

From Discord: Issue with S.omit not removing fields from schema #4603

effect-bot opened this issue Mar 14, 2025 · 0 comments · Fixed by #4588
Assignees
Labels
bug Something isn't working schema

Comments

@effect-bot
Copy link

Summary

In the conversation, _kedi and spaethnl are discussing an issue with the S.omit method from the Effect Typescript library, where it doesn't remove fields as expected from a schema. _kedi provides examples indicating that S.omit does not work after using a filter or even in a simple schema transformation.

Spaethnl suggests that when S.omit is used after a filter operation, it fails to work, and recommends moving S.omit before the filter as a workaround. _kedi, however, points out that S.omit also fails in a scenario without a filter.

Gcanti acknowledges a bug with the filtering process and demonstrates it with an example, showing that after applying a filter, the S.omit operation does not properly remove fields.

Key Takeaways:

  1. There appears to be a bug in the Effect Typescript library where S.omit does not work correctly when used after a filter operation.
  2. The issue seems to affect operations even without filtering, as noted by _kedi.
  3. The issue should ideally be either fixed to work in all scenarios or should be restricted by type-checking to prevent unexpected behavior.
  4. Gcanti confirms the potential bug with an example, showing that S.omit results in an empty list of property signatures after being applied following a filter.

Discord thread

https://discord.com/channels/795981131316985866/1349848817217830993

@gcanti gcanti added bug Something isn't working schema labels Mar 14, 2025
@gcanti gcanti self-assigned this Mar 14, 2025
gcanti added a commit that referenced this issue Mar 14, 2025
@gcanti gcanti closed this as completed in be12983 Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working schema
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants