clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.15k stars 100 forks source link

Move connection events to reducers #309

Closed RReverser closed 8 months ago

RReverser commented 8 months ago

Description of Changes

(WIP) This changes __identity_connected__ and __identity_disconnected__ to become plain reducers instead of Wasm exports.

API and ABI

If the API is breaking, please state below what will break

gefjon commented 8 months ago

If you rename the bindings to be __client_connected__ and __client_disconnected__, then I won't have to do it in #299 , and we can avoid some merge conflicts.

RReverser commented 8 months ago

If you rename the bindings to be __client_connected__ and __client_disconnected__

Hm what do you mean? I don't see those names in #299, and those are no longer bindings - they're just reducers, so they get the optional context now like any other reducer.

gefjon commented 8 months ago

I haven't made that change yet in #299, but I need to. Whether they're reducers or special functions, with #299 the name __identity_connected__ will no longer be accurate. (Arguably it was never accurate, since it was always possible to have multiple concurrent connections from the same identity, but now we're acknowledging that fact.)

RReverser commented 8 months ago

Ah ok... in that case let's just leave it for a separate PR since it's technically an improvement out of scope of either of those PRs. The smaller PRs, the easier to deal with said merge conflicts.

I don't mind rebasing mine if #299 lands first.

gefjon commented 8 months ago

Ugh, that same mysterious should-be-unreachable failure in the SDK tests. Sigh.