-
Notifications
You must be signed in to change notification settings - Fork 609
core: disconnect clients #3275
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
core: disconnect clients #3275
Conversation
a6e35ec
to
ec9f02a
Compare
3a0e6bd
to
49cfb51
Compare
16f51b1
to
068d84f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks! This seems like the correct way to disconnect clients.
Actually, I realized I'm not confident that we correctly call the client_disconnected reducers here.
How does |
Dropping
client.disconnect() imeplementation calls ModuleHost::disconnect_client() which does the job.
|
Co-authored-by: Phoebe Goldman <[email protected]> Signed-off-by: Shubham Mishra <[email protected]>
I fixed |
Description of Changes
The
AutoMigrateStep::DisconnectAllUsers
step is implemented as follows:The
spacetimedb::db::update::update_database
function returns a response of typeUpdateDatabaseResult::UpdatePerformedWithClientDisconnect
.Upon receiving this response, the
host_controller::update_module
proceeds to drop thewatch::Sender<ModuleHost>
field within thecore::host_controller::Host
and disconnect clients.companion private PR - https://github.com/clockworklabs/SpacetimeDBPrivate/pull/2095
API and ABI breaking changes
NA
Expected complexity level and risk
Diff code is simple but It depends on the subcription logic to behave correctly.
Testing
Manually.