Skip to content

fix(bindx): support direct field access on PlaceholderHandle proxy#7

Merged
matej21 merged 1 commit intomainfrom
fix/placeholder-handle-field-access
Apr 1, 2026
Merged

fix(bindx): support direct field access on PlaceholderHandle proxy#7
matej21 merged 1 commit intomainfrom
fix/placeholder-handle-field-access

Conversation

@vparys
Copy link
Copy Markdown
Member

@vparys vparys commented Apr 1, 2026

Summary

  • PlaceholderHandle.wrapProxy used createAliasProxy which only strips the $ prefix but does not delegate unknown properties to target.fields. This caused entity.fieldName to return undefined for placeholder entities (e.g. when creating new entities via HasOne). Switched to createHandleProxy to match EntityHandle behavior.
  • ActionDispatcher SET_PLACEHOLDER_DATA now transitions disconnected relations to creating state, ensuring placeholder data is properly tracked for new entities.

Test plan

  • bun test passes
  • Creating a new entity via <Entity entity={schema.X} create> and accessing fields like entity.name works without errors

PlaceholderHandle.wrapProxy used createAliasProxy which only strips the
$ prefix but does not delegate unknown properties to target.fields.
This caused entity.fieldName to return undefined for placeholder
entities (e.g. when creating new entities via HasOne).

Switch to createHandleProxy so that direct field access (entity.name)
resolves through the fields proxy, matching EntityHandle behavior.

Also transition disconnected relations to 'creating' state when
SET_PLACEHOLDER_DATA is dispatched, ensuring placeholder data is
properly tracked for new entities.
@matej21 matej21 merged commit 7d13064 into main Apr 1, 2026
3 checks passed
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.

2 participants