Skip to content

Detect or support table handles from a duplicate spacetimedb SDK copy in schema() #5746

Description

@cloutiertyler

Full report with minimal repro: #5740

Short version: a TS library that depends on spacetimedb and exports table() handles produces a silently corrupted schema when a consumer (with its own SDK copy, e.g. via link:/file: or any unhoisted duplicate) passes those handles into schema(). Publish succeeds with wrong row types, then reducers fatal at runtime.

Requested outcome, either is acceptable:

  1. Make foreign-copy handles work (structural interning), or
  2. Fail loudly at module load with a clear TypeError.

This currently forces the dependency-injection pattern in spacetime-retry-ts and @spacetimedb/cron (spacetimeCron({ table, t, ScheduleAt }), see clockworklabs/SpacetimeDBComponents#3); fixing it in the "make it work" direction lets those libraries drop injection.

cc @cloutiertyler

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions