Skip to content

Conversation

@CameronTofer
Copy link

Summary

  • Fixes crash when using an enum with strings: true as part of a collection key
  • Codegen was always using IndexEncoder.UINT for enum key components, causing "Invalid number" errors when string values were passed
  • Now checks keyType.strings and uses IndexEncoder.STRING when true

Test plan

  • Added test fixture 8 with strings: true enum in collection key
  • Added test case enum with strings: true as key type
  • Verified existing enum test (fixture 6, without strings) still works
  • All 75 tests pass

🤖 Generated with Claude Code

When an enum with `strings: true` was used as part of a collection key,
inserting a record would crash with "Invalid number <value>" because the
codegen always generated IndexEncoder.UINT for enum key components,
regardless of the strings flag. This meant string values like "pending"
were passed to UINT.encode() which expects integers.

Now checks keyType.strings and uses IndexEncoder.STRING when true.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant