@lmzhen/dsh-evolution-state-domain 0.3.36 → 0.3.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +4 -4
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -141,7 +141,7 @@ function apply(ctx) {
141
141
  };
142
142
  return slot.record;
143
143
  });
144
- return slot.record;
144
+ return slot.record === null ? null : { ...slot.record };
145
145
  } catch (error) {
146
146
  if (error instanceof DomainError && error.code === "missing-key") return null;
147
147
  throw error;
@@ -170,7 +170,7 @@ function apply(ctx) {
170
170
  const table = (await ensure()).table("pending");
171
171
  try {
172
172
  const resolved = { record: null };
173
- const record = await table.update(id, (current) => {
173
+ const rawRecord = await table.update(id, (current) => {
174
174
  if (!canResolvePending(current.status)) return current;
175
175
  resolved.record = {
176
176
  ...current,
@@ -180,11 +180,11 @@ function apply(ctx) {
180
180
  return resolved.record;
181
181
  });
182
182
  if (resolved.record === null) return {
183
- record,
183
+ record: rawRecord === null ? null : { ...rawRecord },
184
184
  applied: false
185
185
  };
186
186
  return {
187
- record: resolved.record,
187
+ record: { ...resolved.record },
188
188
  applied: true
189
189
  };
190
190
  } catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-state-domain",
3
3
  "description": "storage-domain provider for evolution state (community build)",
4
- "version": "0.3.36",
4
+ "version": "0.3.38",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -36,11 +36,11 @@
36
36
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
37
37
  "@deepseek-ai/cordis": "^4.0.1",
38
38
  "@deepseek-ai/dsh-storage-domain": "^0.1.1-rc.2",
39
- "@lmzhen/dsh-evolution-state-storage": "^0.3.36"
39
+ "@lmzhen/dsh-evolution-state-storage": "^0.3.38"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
43
43
  "@deepseek-ai/dsh-storage-domain": "^0.1.1-rc.2",
44
- "@lmzhen/dsh-evolution-state-storage": "^0.3.36"
44
+ "@lmzhen/dsh-evolution-state-storage": "^0.3.38"
45
45
  }
46
46
  }