Files
SpacetimeDB/SpacetimeDB.ClientSDK.sln
james gilles cf25e6be3f Fix for unsubscribe bug + regression tests (#264)
## Description of Changes

This PR fixes one issue and adds regression tests for it, plus another
issue. These regression tests are run on CI. You can also run them
locally -- run a local spacetime instance and then
`tools~/run-regression-tests.sh ../SpacetimeDB`).

### Issue 1: Unsubscribe is non-functional

See
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/issues/279.
This was a coding mistake made during the rush to 1.0. It was easily
fixed.

### Issue 2: Indexes not tracking deletes

This was recently discovered by the BitCraft team.

The problem was introduced in
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/commit/cefc727b7693fe97e3dd848fef2bb17bf20c8be6
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` formerly was not implemented for `[SpacetimeDB.Type]`s or
for generated Row types. So, this didn't work.

Now it does: it was fixed by
https://github.com/clockworklabs/SpacetimeDB/pull/239 . So all this PR
does to address this issue is add a regression test.

## API

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

The interface IDbConnection was changed; however, this changed part of
the interface is `internal`, so this should be entirely invisible to
users.

## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/239 (merged)

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

- [x] Added a repro for both issues
- [x] Added the repro to CI
- [x] Fixed both issues
2025-03-28 20:15:51 +00:00

59 lines
3.6 KiB
Plaintext

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33717.318
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpacetimeDB.ClientSDK", "SpacetimeDB.ClientSDK.csproj", "{242A8146-A58D-43E9-A2BD-31FFC6851AA6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests~\tests.csproj", "{5CD31104-4719-4CE3-8D39-8BAE0B75C085}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "examples~\quickstart-chat\client\client.csproj", "{FE261832-1594-DE21-C8C8-2D525680CBD7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples~", "examples~", "{E0CADA48-79A1-4490-ACEC-698EC7D2AB43}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "regression-tests", "regression-tests", "{4434F63A-3300-476E-82F3-D672B83E68E8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StdbModule", "examples~\regression-tests\server\StdbModule.csproj", "{A68A749E-CFE1-45CF-8BDA-929B2E677D72}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client", "examples~\regression-tests\client\client.csproj", "{5BB2A377-C44C-4310-8951-BB37F5EB8456}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{242A8146-A58D-43E9-A2BD-31FFC6851AA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{242A8146-A58D-43E9-A2BD-31FFC6851AA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{242A8146-A58D-43E9-A2BD-31FFC6851AA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{242A8146-A58D-43E9-A2BD-31FFC6851AA6}.Release|Any CPU.Build.0 = Release|Any CPU
{5CD31104-4719-4CE3-8D39-8BAE0B75C085}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CD31104-4719-4CE3-8D39-8BAE0B75C085}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CD31104-4719-4CE3-8D39-8BAE0B75C085}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CD31104-4719-4CE3-8D39-8BAE0B75C085}.Release|Any CPU.Build.0 = Release|Any CPU
{FE261832-1594-DE21-C8C8-2D525680CBD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE261832-1594-DE21-C8C8-2D525680CBD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE261832-1594-DE21-C8C8-2D525680CBD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE261832-1594-DE21-C8C8-2D525680CBD7}.Release|Any CPU.Build.0 = Release|Any CPU
{A68A749E-CFE1-45CF-8BDA-929B2E677D72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A68A749E-CFE1-45CF-8BDA-929B2E677D72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A68A749E-CFE1-45CF-8BDA-929B2E677D72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A68A749E-CFE1-45CF-8BDA-929B2E677D72}.Release|Any CPU.Build.0 = Release|Any CPU
{5BB2A377-C44C-4310-8951-BB37F5EB8456}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5BB2A377-C44C-4310-8951-BB37F5EB8456}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5BB2A377-C44C-4310-8951-BB37F5EB8456}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5BB2A377-C44C-4310-8951-BB37F5EB8456}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {35C59D87-64E5-4A6C-B1D5-2241B946E847}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4434F63A-3300-476E-82F3-D672B83E68E8} = {E0CADA48-79A1-4490-ACEC-698EC7D2AB43}
{A68A749E-CFE1-45CF-8BDA-929B2E677D72} = {4434F63A-3300-476E-82F3-D672B83E68E8}
{5BB2A377-C44C-4310-8951-BB37F5EB8456} = {4434F63A-3300-476E-82F3-D672B83E68E8}
EndGlobalSection
EndGlobal