polygram 0.13.1 → 0.13.2

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.
@@ -106,10 +106,19 @@ function createDownloadAttachments({
106
106
  } catch (e) {
107
107
  if (e.code === 'EEXIST') {
108
108
  logger.log?.(`[attach] ${chatId} ← ${att.kind} ${safeName} (race: already on disk)`);
109
- } else if (e.code === 'EXDEV') {
110
- fs.copyFileSync(fileInfo.file_path, localPath); // cross-device fallback
111
109
  } else {
112
- throw e;
110
+ // A hard link can fail even when a byte copy succeeds: EXDEV (the
111
+ // bot-api data dir is a different device/overlay than the inbox) or
112
+ // EPERM (the volume's filesystem refuses a cross-fs / cross-owner
113
+ // hard link — the local Bot API container writes files as a
114
+ // different user, e.g. `messagebus`, and polygram reads them via
115
+ // group membership). Copy works whenever we can READ the source
116
+ // (group perm) + WRITE the inbox; if the source read is genuinely
117
+ // denied, copyFileSync throws EACCES and the outer handler marks
118
+ // the attachment failed. Falling back on EXDEV only (the old
119
+ // behaviour) left EPERM uncaught → every inbound file failed once
120
+ // the local Bot API server was a Docker volume (2026-06-16).
121
+ fs.copyFileSync(fileInfo.file_path, localPath);
113
122
  }
114
123
  }
115
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polygram",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Telegram daemon for Claude Code that preserves the OpenClaw per-chat session model. Migration path for OpenClaw users moving to Claude Code.",
5
5
  "main": "lib/ipc/client.js",
6
6
  "bin": {