dsh-session-cloud 0.1.2 → 0.1.3

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/sync/engine.js +14 -1
  2. package/package.json +1 -1
@@ -248,7 +248,20 @@ export class SyncEngine {
248
248
  await store.putSession(id, state);
249
249
  return;
250
250
  }
251
- const stat = await fsp.stat(location.path);
251
+ let stat;
252
+ try {
253
+ stat = await fsp.stat(location.path);
254
+ }
255
+ catch (error) {
256
+ if (error.code !== 'ENOENT')
257
+ throw error;
258
+ // v1 宿主 list() 含「已创建未物化」的会话(首个 append 前无文件),
259
+ // 也可能撞上并发删除。记 revision 静默跳过:物化或内容变更会改
260
+ // revision,下一轮 scan 自然重新调度。
261
+ state.localRevision = revision;
262
+ await store.putSession(id, state);
263
+ return;
264
+ }
252
265
  if (stat.size < state.uploadedBytes) {
253
266
  // 文件变短(防御:正常不可达)——回退全量重传
254
267
  Object.assign(state, freshSessionState());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-cloud",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "E2E-encrypted cloud mirror plugin for deepseek-harness sessions",
5
5
  "type": "module",
6
6
  "publishConfig": {