# Description of Changes
Fixes a Typescript SDK bug where onclose of WebsocketDecompressAdapter
is never called
# API and ABI breaking changes
None
<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->
# Expected complexity level and risk
Potential risk as Typescript SDK consumers might be currently relying
only on onConnectError to report disconnection. Users should instead use
onDisconnect, or can simply subscribe to both callbacks with the same
function again to get the same functionality.
<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.
This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.
If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->
This is a trivial change, but could have minor repercussions on current
code. I'd still say it's a level 1 change, with consumers able to easily
change to the correct callback.
# Testing
<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->
# Description of Changes
Updated outdated repository link in documentation from
`https://github.com/ClockworkLabs/tree/master/demo/Blackholio`
to
`https://github.com/clockworklabs/SpacetimeDB/tree/master/demo/Blackholio`
to reflect the current location of the Blackholio demo.
# API and ABI breaking changes
None.
# Expected complexity level and risk
Complexity level: **1** (trivial change)
This is a simple documentation update with no impact on code execution,
APIs, or ABIs.
# Testing
Verified that the new link is valid and accessible.
No additional testing required.
* [ ] Reviewer can confirm that the new link resolves correctly.
# Description of Changes
As requested by @gefjon
Most of this is:
- `'a` -> `'this`
- `'s` -> `'scope`
# API and ABI breaking changes
None
# Expected complexity level and risk
0
# Testing
No semantic changes.
# Description of Changes
On databases with many already-compressed snapshots, this was leading to
log spam without providing any useful information.
# API and ABI breaking changes
N/a
# Expected complexity level and risk
1
# Testing
N/a
# Description of Changes
- Previous to this PR if you login, create a player, then logout and log
back in you are prompted for a username again instead of just resuming
your gameplay. This is confusing to players because it seems like your
token is not being reused and you are just creating a new player.
# API and ABI breaking changes
None
# Expected complexity level and risk
1 - this is a demo change but technically affects the testsuite
# Testing
1. Clear your token, then open the game, create a player. Then logout
2. Without clearing your token, log back into the game.
3. Make sure that:
- Your username is correct
- Your circles are where you left them (and the amount of circles is
correct.)
Adds methods and free-standing functions to allow folds to stop at an
upper
bound, by passing a range instead of only a start offset.
# Expected complexity level and risk
1
# Testing
# Description of Changes
Currently with the function maybe_log_error to log errors we hide the
real source line where the error happened. So to still have the same
logic but with more accurate source line, I moved it to a macro to have
the same abstraction for logging.
# API and ABI breaking changes
-
# Expected complexity level and risk
1
# Testing
- [ ] I have tested it my application and it now show the better source
line of the log message
---------
Signed-off-by: ResuBaka <ResuBaka@users.noreply.github.com>
Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
# Description of Changes
Added a repo migration notice workflow to each repository that we've
merged into SpacetimeDB.
These need to be mirrored back to the actual repos with a process like:
```bash
git subtree split --prefix=sdks/typescript -b release/typescript
git push -f git@github.com:clockworklabs/spacetimedb-typescript-sdk.git release/typescript:main
git branch -D release/typescript
```
Once they're migrated there, the bot will automatically comment on any
PR or issue opened in those repos.
# API and ABI breaking changes
None. CI-only changes.
# Expected complexity level and risk
2
# Testing
- [x] In a demo repo, it properly commented and closed a PR:
https://github.com/clockworklabs/github-tooling-test/pull/42
- [x] In a demo repo, it properly commented and closed an issue:
https://github.com/clockworklabs/github-tooling-test/issues/43
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
We want to release #2980 for the TS SDK, so I'm bumping our version
number.
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
None, just a version bump.
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes
Moves table-specific operations out of `SpacetimeDBClient.cs` and into
`Table.cs` in order to reduce coupling between the two files.
This is the implementation of
https://github.com/clockworklabs/SpacetimeDB/issues/3047
This is a PR being duplicated/migrated from
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/pull/346,
which contains prior discussion/review/approval.
## API
- [ ] This is an API breaking change to the SDK
## Requires SpacetimeDB PRs
No PRs needed, works with latest master
## Testsuite
SpacetimeDB branch name: master
## Testing
- [X] Opened and ran Blackhol.io within Unity Editor and successfully
connecting to a locally running server
- [X] Compiled a WebGL build of Blackhol.io and successfully connecting
to a locally running server
- [x] Opened and ran BitCraft within Unity Editor and successfully
connecting to a locally running server
# Description of Changes
We haven't used this in a while and we're pretty sure it's currently
broken.
# API and ABI breaking changes
None.
# Expected complexity level and risk
1
# Testing
None
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
I forgot to do this in the original version bump PR... I just ran
`dotnet pack` and then moved the meta files.
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
None.
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
A few of our new CI checks weren't set up to run in the merge queue,
which prevented PRs from merging when those checks were marked required.
# API and ABI breaking changes
None. CI only change.
# Expected complexity level and risk
1
# Testing
This will have to be tested by making these checks required again, and
then seeing if this PR can merge.
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
Just what it says on the can. This test suite can sometimes mysteriously
hang for a long time, so a timeout will help kill this (and free up
resources) earlier.
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
None really. I guess I could test this by adding a step that just sleeps
forever, but this is basically just setting some data.
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# 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
2. The risk here is people relying on that behavior.
# Testing
I think some tests need to be updated.
# Description of Changes
The `ScheduleAt` type appears to have an outdated structure. I've
updated the structure of the `ScheduleAt` type represented in TypeScript
to be in line with the Rust type:
https://docs.rs/spacetimedb/latest/spacetimedb/enum.ScheduleAt.html
Namely, we were missing the inner Spacetime library types of
`TimeDuration` and `Timestamp`.
This is to address #2969.
# API and ABI breaking changes
This is an API breaking change in that it changes the API, but it's
breaking in that it fixes a bug.
# Expected complexity level and risk
2
# Testing
I have not done additional testing, but I thought I would get this PR
started to make it easier for the next person who comes along.
The ideal automated test to add would be one which connects a TypeScript
client to a SpacetimeDB module with a scheduled table, and verifies that
the type is correctly deserialized and represented in TypeScript when
the rows are sent down.
---------
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
Until we have confirmed reads, we need to wait for a tick until any
batched commits are flushed.
Also cleaned up the code a bit to do less string manipulation of sql
results all over the place, and to output less irrelevant logging.
# Expected complexity level and risk
1
# Testing
- [x] yes
# Description of Changes
Avoid building a temporary `Vec` in `execute_plan` by exposing a
list-building interface instead.
- The old `fn encode_list` is rewritten in terms of this list-building
interface.
- The `BsatnRowList` and `BsatnRowListBuilder` types are split into two
entirely separate types. The latter now tries to recognize the case
where there isn't a known static layout, but where the BSATN lengths
happen to be the same for all rows anyways. In those cases, the
allocation of `RowSizeHint::RowOffsets` is avoided in favor of just
storing the found length in bytes. This is in particular useful for
small table updates as statistically, the fewer rows, the more chance of
the lengths being all equal. In the case of a single row, the chance is
notably 100%. It is also good for the case of when we don't have
`RelValue::Row` or `Row::Ptr` but where the underlying table that
actually has a static layout.
In the future, we might want to avoid these lists in incremental as
well.
# Benchmarks
Benchmark numbers vs. master using `cargo bench --bench subscription --
--baseline subs` on i7-7700K, 64GB RAM:
```
footprint-scan time: [28.731 ms 28.924 ms 29.171 ms]
change: [-49.728% -49.006% -48.388%] (p = 0.00 < 0.05)
Performance has improved.
```
Performance goes from roughly 56.721 ms to 28.795 ms.
# API and ABI breaking changes
None
# Expected complexity level and risk
2, fairly local change to just subscriptions.
# Testing
Covered by existing tests.
# Description of Changes
Bumped all versions to 1.3.0 in preparation for an upcoming minor
release.
# API and ABI breaking changes
No breaking changes.
# Expected complexity level and risk
1
# Testing
None
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
New Unity test suite runs will cancel existing in-progress runs on the
same PR or github ref.
I tried to add a global limit of 2 test suites running at the same time,
but I did not find a successful way of making this work.
# API and ABI breaking changes
None. CI-only change.
# Expected complexity level and risk
1
# Testing
- [x] Test suite still runs and succeeds
- [x] If I push several commits in a row, previous runs get cancelled
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
Out-of-band discussions with the BitCraft team brought up questions
about whether it was possible for a rejected client connection to start
an expensive computation like a subscription before their connection was
killed, e.g. by sending a `Subscribe` message along the WebSocket before
`client_connected` had finished returning `Err`.
I don't believe this was actually possible, as `ClientConnection::spawn`
called and awaited `call_identity_connected` before invoking its `actor`
closure, and it was that `actor` which processed `Subscribe` messages.
But it was somewhat difficult to verify that behavior, and so I
re-organized the code so that the outer layer of the `subscribe` handler
obviously had that property without having to step into
`ClientConnection::spawn`.
I also added some additional logging to the subscribe route, including
the `X-Forwarded-For` header in more messages, as the BitCraft team
complained about having difficulty correlating IP addresses with
connections. The log levels remain the same as before, just with
additional information added:
- Successful connections are at `debug` level,
- Rejected connections are at `info` level (these are the ones BitCraft
cares about in this case).
- Failed connections are at `warn`.
As the levels are unchanged, this should not add undesirable log noise.
# API and ABI breaking changes
N/a
# Expected complexity level and risk
3? The `subscribe` route was complex and remains so. I believe this
change simplifies the code and makes the logic more obvious, but
reviewers should take care to verify that the behavior actually is
equivalent as I believe.
# Testing
- [ ] I would like a test deployment of BitCraft to staging or
something, or to include this patch in the next bot test that we do
anyways, just for sanity's sake.
# Description of Changes
Some small CI tweaks related to the monorepo merge.
Once we've landed these, I think we can make most of the new checks
required.
# API and ABI breaking changes
CI only changes
# Expected complexity level and risk
1
# Testing
None, just tweaked names.
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
Bumping this in preparation for an upcoming release.
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
None, just a version bump
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
I ran `python3 tools~/upgrade-version.py 1.2.2` in preparation for an
upcoming release.
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
None, just a version bump.
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
This PR helps to support React Native in the Typescript SDK. We have
identified two issues:
1. Certain versions of React Native exhibit a bug where the constructor
mistakenly treats a URL object as a string. This causes an error when
the constructor attempts to call `.endsWith()` on the URL object,
leading to runtime errors. This PR adds a .toString() call when passing
a URL instance to the URL constructor.
2. React Native doesn't provide an implementation for TextEncoder and
TextDecoder which are used to read/write strings in our binary reader
and writer. This PR use introduce the usage of a library for these two
types.
Note: this still requires the use of a Polyfill as React Native URL
implementation is missing most methods in version older than 0.79 (>= 6
month old)
# Description of Changes
We recently merged several repos into the SpacetimeDB repo. This PR
update the docs accordingly.
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
None, just docs
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
# Description of Changes
Add a guard against `stack overflow` in case of nested expression and
`joins`.
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
- [x] Find how `deep` can be recursed the affected functions and put a
limit on it
- [x] Add a extra test to prove we can (in theory) do lots of `joins` in
the planning steps, even if executing them will be slow
# Description of Changes
Adds a method on `SnapshotDir` to return snapshot offset.
# API and ABI breaking changes
N/A
How complicated do you think these changes are? Grade on a scale from 1
to 5,
1
# Testing
Added unit test
# Description of Changes
This is a fix for community bug which auth token is not used to create
Websocket connection in Unity WebGL build.
The issue here:
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/issues/352
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
- [ ] Using OAuth2.0 tokens, you should get the same `Identity` even
when the token is refreshed in the WebGL build
Python has a funny way of dealing with absent values.
Fixes (again) restart tests to handle slowly restarting containers.
# Expected complexity level and risk
1
# Testing
n/a
The `subscribe` command would drop the connection without sending a
close frame. Doing so creates a warning on the server, which can be
distracting when debugging other connections issues.
# Expected complexity level and risk
1
# Testing
Use the `subscribe` command with a local database and compare server
logs before
and after.