effect icon indicating copy to clipboard operation
effect copied to clipboard

From Discord: Resolving Kysely Integration Issues in Effect with SqlResolver

Open effect-bot opened this issue 1 year ago • 1 comments

Summary

Summary

Issue Encountered:

  • User xesrevinu encountered an error (Proxy Magic) while using Kysely integration with SqlResolver in Effect.
  • The error was temporarily resolved by wrapping the database query in Effect.suspend.

Reproduction:

  • A minimal reproduction of the issue was provided using Vitest for testing in the Effect repository.

Resolution:

  • User ecyrbedev identified the issue as related to the proxy not whitelisting the compile method.
  • A fix was implemented and a PR was created and merged directly into the next-minor branch.

Additional Issue:

  • User xesrevinu identified another scenario requiring handling of Hash.symbol to avoid a TypeError when using Effect.annotateLogs.

Key Takeaways

  1. Proxy Whitelisting:

    • Ensure all necessary methods (like compile) are whitelisted in the proxy to avoid runtime errors.
  2. Auto-Merge Behavior:

    • Be cautious with PR titles and branches to avoid unexpected auto-merges.
    • Confirm if auto-merge is enabled and understand its behavior in the repository.
  3. Handling Special Symbols:

    • Additional handling may be required for special symbols like Hash.symbol to ensure proper functionality and avoid TypeError.
  4. Community Collaboration:

    • Effective communication and collaboration (e.g., minimal repros, quick fixes) are crucial for resolving issues efficiently in open-source projects.
  5. Testing and Validation:

    • Use testing frameworks like Vitest to create minimal reproductions and validate fixes before merging changes.

By addressing these points, the Effect-TS ecosystem can improve its robustness and developer experience.

Discord thread

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

effect-bot avatar Jul 18 '24 14:07 effect-bot

I'll add more tests to cover more use cases, and add corresponding proxy whitelisting

ecyrbe avatar Jul 19 '24 07:07 ecyrbe