clockworklabs / SpacetimeDB

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

Correct `Schema::check_compatible` to resolve types in a ModuleDef #1813

Closed kazimuth closed 1 month ago

kazimuth commented 1 month ago

Description of Changes

When performing an automatic migration, we check the old moduledef is compatible with the data stored in the system tables. But right now, the types stored in the system tables are resolved, but the types in the moduledef are not. So the check breaks on nested types. This PR fixes that and adds a regression test for it.

I'd like to do a followup PR adding more intensive automigration testing.

Expected complexity level and risk

0

Testing

Added a failing test, fixed the test.

bfops commented 1 month ago

This fixes the issue for me! I don't really understand the context around this code but seems like an improvement.