Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-monorepo",
"version": "0.9.77",
"version": "0.9.78",
"private": true,
"scripts": {
"build": "pnpm -r run build",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-ai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-ai",
"version": "0.9.77",
"version": "0.9.78",
"description": "Cross-agent architecture skills for @adobe/data — installable as a Claude Code plugin or copied into any Agent-Skills-compatible agent (Cursor, Codex).",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-gpu-samples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-gpu-samples",
"version": "0.9.77",
"version": "0.9.78",
"description": "WebGPU samples built on @adobe/data-gpu",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-gpu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-gpu",
"version": "0.9.77",
"version": "0.9.78",
"description": "Adobe data WebGPU plugins and types for graphics and compute",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit-tictactoe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-lit-tictactoe",
"version": "0.9.77",
"version": "0.9.78",
"description": "Tic-Tac-Toe sample - Lit web components with @adobe/data-lit and AgenticService",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit-todo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-lit-todo",
"version": "0.9.77",
"version": "0.9.78",
"description": "Todo sample app demonstrating @adobe/data with Lit",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-lit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-lit",
"version": "0.9.77",
"version": "0.9.78",
"description": "Adobe data Lit bindings - hooks, elements, decorators",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-p2p-tictactoe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-p2p-tictactoe",
"version": "0.9.77",
"version": "0.9.78",
"description": "Serverless P2P tic-tac-toe — WebRTC DataChannel + @adobe/data-sync",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-persistence/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-persistence",
"version": "0.9.77",
"version": "0.9.78",
"description": "Worker-based incremental persistence layer for @adobe/data ECS over OPFS (browser) and node:fs (server).",
"type": "module",
"sideEffects": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react-hello/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-react-hello",
"version": "0.9.77",
"version": "0.9.78",
"description": "Hello World sample - click counter using @adobe/data-react",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react-pixie/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-react-pixie",
"version": "0.9.77",
"version": "0.9.78",
"description": "PixiJS React sample - ECS sprites (bunny, fox) with @adobe/data-react",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-react",
"version": "0.9.77",
"version": "0.9.78",
"description": "Adobe data React bindings — hooks and context for ECS database",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-solid-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-solid-dashboard",
"version": "0.9.77",
"version": "0.9.78",
"description": "Mini dashboard sample — multiple components sharing one @adobe/data ECS database with SolidJS",
"type": "module",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-solid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-solid",
"version": "0.9.77",
"version": "0.9.78",
"description": "Adobe data SolidJS bindings — context and provider for ECS database",
"type": "module",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data-sync/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data-sync",
"version": "0.9.77",
"version": "0.9.78",
"description": "Multi-user real-time synchronisation for @adobe/data ECS — server, client, and in-process loopback.",
"type": "module",
"sideEffects": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/data",
"version": "0.9.77",
"version": "0.9.78",
"description": "Adobe data oriented programming library",
"type": "module",
"sideEffects": false,
Expand Down
13 changes: 13 additions & 0 deletions packages/data/src/ecs/store/core/create-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,19 @@ export function createCore<NC extends ComponentSchemas>(newComponentSchemas: NC)
return;
}
Object.assign(componentSchemas, data.componentSchemas);
// The non-persistent (negative-ID) space is never captured by
// toData, so a load must revert it to defaults rather than leak the
// loading store's pre-load live values across the load. Clear it the
// same way reset() does; the persistent side below is fully
// overwritten by the restore, so only the nonPersistent rows need
// clearing here. The store layer re-seeds nonPersistent resource
// defaults afterward (its rowCount === 0 re-init guard).
nonPersistentLocationTable.reset();
for (const archetype of archetypes) {
if (archetype.components.has("nonPersistent")) {
archetype.rowCount = 0;
}
}
persistentLocationTable.fromData(data.entityLocationTableData);
for (const { componentNames, data: archetypeData } of data.archetypesData) {
// Recreating the archetype reserves its id and leaves it
Expand Down
54 changes: 54 additions & 0 deletions packages/data/src/ecs/store/public/create-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,60 @@ describe("createStore", () => {
expect((newStore.resources as any).score).toBe(0);
});

it("reverts a nonPersistent resource to its default when loading into a populated (non-fresh) store", () => {
const schema = {
components: {},
resources: {
score: { default: 0 as number, nonPersistent: true },
persistentScore: { default: 0 as number },
},
archetypes: {},
} as const;

// Save a snapshot from a source store.
const source = createStore(schema as any);
(source.resources as any).persistentScore = 123;
const snapshot = source.toData(true);

// Load into a store that ALREADY holds non-default state — the
// same-instance Save-As -> Load path. The nonPersistent resource
// is never captured by toData, so the only correct post-load value
// is its default. Leaving the pre-load live value in place would
// leak it across the load (the stale-blob-URL bug). This must match
// reset()'s treatment of the nonPersistent space.
const target = createStore(schema as any);
(target.resources as any).score = 999;
(target.resources as any).persistentScore = 456;
target.fromData(snapshot);

expect((target.resources as any).score).toBe(0);
expect((target.resources as any).persistentScore).toBe(123);
});

it("clears a nonPersistent entity present before the load when loading into a populated store", () => {
const selectionSchema = { type: "boolean", default: false } as const satisfies Schema;
const makeStore = () => createStore({
components: { selection: selectionSchema },
resources: {},
archetypes: {},
});

const source = makeStore();
const snapshot = source.toData(true);

// Target holds a nonPersistent entity (negative-ID space) before the
// load. fromData must clear it — the nonPersistent space is never
// serialized, so a load resets it exactly as reset() would.
const target = makeStore();
const selectionArchetype = target.ensureArchetype(["id", "selection", "nonPersistent"]);
const selectionEntity = selectionArchetype.insert({ selection: true, nonPersistent: true });
expect(target.read(selectionEntity)).not.toBeNull();

target.fromData(snapshot);

expect(target.read(selectionEntity)).toBeNull();
});

it("preserves archetype ids across serialization when a nonPersistent archetype precedes a persistent one", () => {
const selectionSchema = { type: "boolean", default: false } as const satisfies Schema;
const positionScalarSchema = { type: "number", default: 0 } as const satisfies Schema;
Expand Down