Make DatasetStore the collision-free id authority

This commit is contained in:
2026-06-07 23:05:51 +03:00
parent 1cad9ba140
commit 5ea2a0d038
4 changed files with 96 additions and 15 deletions
+3 -1
View File
@@ -11,7 +11,9 @@ const T = new Date('2026-06-01T00:00:00Z');
function seedDataset(name: string, data: unknown): number {
const ds = createDataset({ name, data, format: 'json', source: 'inline', now: T });
useDatasetStore.getState().add(ds);
return ds.id;
// `add` is the id authority and reassigns a collision-free id, so read it back
// rather than trusting the pre-add createDataset default.
return useDatasetStore.getState().datasets[0].id;
}
beforeEach(() => {