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

Prevent remote function errors with actors #146

Merged

Conversation

Ketasaja
Copy link
Contributor

@Ketasaja Ketasaja commented Jan 13, 2025

Since there can be multiple Zap instances when using actors, there can be multiple RemoteEvent.OnClientEvent listeners. Only the listener from the VM that fired the remote function will have a valid thread to resume execution at. This change simply ignores the remote function return on any other VM.

Reported by Phoenix in ROSS.

Copy link
Collaborator

@sasial-dev sasial-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how I feel about your change to be honest, as while it does fix the issue, it technically introduces the possibility for an event to be dropped which I don't like.
So I'll leave it open for a little and get some input from others.

(message from this Discord thread)

Copy link
Collaborator

@sasial-dev sasial-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to properly handle YieldType::Promise as well as otherwise we'll still get the same error

@Ketasaja Ketasaja requested a review from sasial-dev January 14, 2025 14:49
Copy link
Collaborator

@sasial-dev sasial-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sasial-dev sasial-dev merged commit 86451eb into red-blox:0.6.x Jan 15, 2025
2 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