Skip to content

Conversation

@jsdt
Copy link
Contributor

@jsdt jsdt commented Jul 30, 2025

Description of Changes

This changes the behavior on the rust client, so that we let the server generate the connection id if the client hasn't called the unstable method to set a connection id.

This is awkward for the connection_id function, since it now panics if the connection id hasn't been received from the server. We should deprecate this function in favor of a try version.

This also changes the behavior of reusing the connection id if a client reconnects.

The corresponding private PR is https://github.com/clockworklabs/SpacetimeDBPrivate/pull/1921.

API and ABI breaking changes

Technically not changing any API signatures, but this is behavior-changing, since the connection_id function can now panic.

Expected complexity level and risk

  1. The risk here is people relying on that behavior.

Testing

I think some tests need to be updated.

@gefjon
Copy link
Contributor

gefjon commented Jul 30, 2025

I don't think we need to deprecate the panicking connection_id function, but we should add the try_connection_id variant and document the difference. Note that we have both identity and try_identity.

Copy link
Contributor

@gefjon gefjon left a comment

Choose a reason for hiding this comment

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

Codegen appears not to have changed other than the commit hash, so I'd suggest we might as well remove those changes to shrink the diff here.

EDIT: I suppose this will change when we add the try_connection_id method, so disregard.

@jsdt jsdt marked this pull request as ready for review July 31, 2025 00:17
@jsdt jsdt enabled auto-merge August 1, 2025 16:19
@jsdt jsdt added this pull request to the merge queue Aug 1, 2025
Merged via the queue into master with commit dae26b2 Aug 1, 2025
25 of 26 checks passed
mamcx pushed a commit that referenced this pull request Aug 26, 2025
# Description of Changes

This changes the behavior on the rust client, so that we let the server
generate the connection id if the client hasn't called the unstable
method to set a connection id.

This is awkward for the `connection_id` function, since it now panics if
the connection id hasn't been received from the server. We should
deprecate this function in favor of a `try` version.

This also changes the behavior of reusing the connection id if a client
reconnects.

The corresponding private PR is
clockworklabs/SpacetimeDBPrivate#1921.

# API and ABI breaking changes

Technically not changing any API signatures, but this is
behavior-changing, since the `connection_id` function can now panic.

# Expected complexity level and risk

2. The risk here is people relying on that behavior.

# Testing

I think some tests need to be updated.
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.

3 participants