Skip to content

Erase client lifecycle handlers through avatar wrapper#125

Merged
ogyrec-o merged 1 commit into
mainfrom
fix/issue-123-erased-client-lifecycle-handler-wrapper
May 28, 2026
Merged

Erase client lifecycle handlers through avatar wrapper#125
ogyrec-o merged 1 commit into
mainfrom
fix/issue-123-erased-client-lifecycle-handler-wrapper

Conversation

@ogyrec-o

Copy link
Copy Markdown
Member

Summary

Follow-up to #124 for #123.

Wraps concrete ClientLifecycleHandler values in an avatar-owned erased registration payload before passing them through the hidden freven_world_api backend boundary.

Why

#124 added the SDK-facing registration boundary, but the initial hidden plumbing passed the concrete handler type H through Box<dyn Any + Send + Sync>.

The engine runtime does not know the concrete H, so it cannot downcast and recover a callable ClientLifecycleHandler.

This PR adds ClientLifecycleHandlerRegistration, which stores Box<dyn ClientLifecycleHandler>. The runtime can downcast the hidden Any payload to this stable avatar-owned wrapper and then store/call the boxed handler.

Boundaries

  • SDK API plumbing only.
  • No engine runtime implementation yet.
  • No Vanilla behavior changes.
  • No server authority changes.
  • No client prediction as authority.
  • Preserves the world/avatar dependency boundary.

Validation

  • cargo +stable check --locked -p freven_avatar_api
  • cargo +stable test --locked --workspace
  • cargo +stable clippy --locked --workspace --all-targets -- -D warnings
  • cargo +stable fmt --all -- --check
  • git --no-pager diff --check

Related

@ogyrec-o ogyrec-o self-assigned this May 28, 2026
@ogyrec-o ogyrec-o merged commit b4fad13 into main May 28, 2026
1 check passed
@ogyrec-o ogyrec-o deleted the fix/issue-123-erased-client-lifecycle-handler-wrapper branch May 28, 2026 17:02
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