@openclaw-china/shared 2026.3.7 → 2026.3.8-1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw-china/shared",
3
- "version": "2026.3.7",
3
+ "version": "2026.3.8-1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -647,7 +647,21 @@ export async function finalizeInboundMediaFile(
647
647
  await fsPromises.mkdir(datedDir, { recursive: true });
648
648
  await fsPromises.rename(current, target);
649
649
  return target;
650
- } catch {
650
+ } catch (error) {
651
+ const code = (error as NodeJS.ErrnoException | undefined)?.code ?? "";
652
+ if (code === "EXDEV") {
653
+ try {
654
+ await fsPromises.copyFile(current, target);
655
+ try {
656
+ await fsPromises.unlink(current);
657
+ } catch {
658
+ // unlink 失败不影响结果,目标文件已可用
659
+ }
660
+ return target;
661
+ } catch {
662
+ return current;
663
+ }
664
+ }
651
665
  return current;
652
666
  }
653
667
  }