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

BTree indexes do not properly track deletes #264

Open
wants to merge 7 commits into
base: release/latest
Choose a base branch
from

Conversation

kazimuth
Copy link
Contributor

@kazimuth kazimuth commented Mar 7, 2025

Description of Changes

This was recently discovered by the BitCraft team. I've added a minimal repro (run a local spacetime instance and then tools~/run-btree-repro.sh ../SpacetimeDB).

The problem was introduced in 20c6480 which introduced RemoteTableHandle<EventContext, Row>.IndexBase<Column>. This class stores a Dictionary<Column, List<Row>> to allow fast filtering. It relies on List<Row>.Remove to remove elements from a list when a row delete is received. List<Row>.Remove relies on Row.Equals to determine when elements are equal.

Row.Equals is not automatically implemented for [SpacetimeDB.Type]s or for generated Row types. So, this doesn't work.

The easiest fix would be to make [SpacetimeDB.Type] automatically implement Equals and HashCode. It would also be good for debugging purposes to implement ToString at the same time.

API

  • This is an API breaking change to the SDK

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

Requires SpacetimeDB PRs

TBD

Testsuite

If you would like to run the your SDK changes in this PR against a specific SpacetimeDB branch, specify that here. This can be a branch name or a link to a PR.

SpacetimeDB branch name: master

Testing

Write instructions for a test that you performed for this PR

  • Added a repro
    • Fixed the repro

joshua-spacetime and others added 7 commits February 26, 2025 13:00
## Description of Changes

Updates comment on `SubscribeToAllTables` since undefined behavior is not possible anymore.

No code changes made in this patch.

## API

 - [ ] This is an API breaking change to the SDK

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

## Requires SpacetimeDB PRs

N/A

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: master

## Testing

No code changes made in this patch.
## Description of Changes

Adds closing `</summary>` to end of comment.

## API

No breaking changes

## Requires SpacetimeDB PRs

N/A

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: master

## Testing

Just fixing a comment. No tests required.
…ument. (#258)

# Description of Changes
Update the C# server and client SDK quickstart-chat example to match the
code presented in the tutorial, as of
clockworklabs/spacetime-docs#170 .
Also renamed the directory from `quickstart` to `quickstart-chat` in
order to be more specific.

# API and ABI breaking changes

If this is an API or ABI breaking change, please apply the
corresponding GitHub label.

# Expected complexity level and risk

1

## Requires SpacetimeDB PRs
SpacetimeDB branch name: master
com.clockworklabs.spacetimedbsdk: master

# 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!*

- [x] Ran `quickstart-chat` C# server and C# client locally and:
  - Set my name.
  - Sent a message.
  - Restarted and viewed the message backlog.
  - Sent a few more messages.
- Exited, deleted my local token, restarted and connected as a new
identity.
  - Set my new identity's name.
  - Sent a message as my new identity.

---------

Co-authored-by: Zeke Foppa <[email protected]>
Co-authored-by: John Detter <[email protected]>
Co-authored-by: james gilles <[email protected]>
## Description of Changes
Just link to the existing docs.

## API

 - [ ] This is an API breaking change to the SDK

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

## Requires SpacetimeDB PRs

## Testsuite

SpacetimeDB branch name: master

## Testing
## Description of Changes
This just bumps our package versions to be 1.0.0.

## API

No breaking changes

## Requires SpacetimeDB PRs
clockworklabs/SpacetimeDB#2283

## Testsuite
SpacetimeDB branch name: bfops/bump-version

## Testing
Existing CI only.

---------

Co-authored-by: Zeke Foppa <[email protected]>
Co-authored-by: John Detter <[email protected]>
Co-authored-by: John Detter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants