feat(worker): log attachments that no detection pattern matched

The .7z.001 gap survived for months because an unmatched attachment left
zero trace anywhere. All three isArchiveAttachment call sites now emit a
debug line with the chat, message id and filename when a document is
skipped, so future gaps of this class are greppable instead of invisible.
Debug level because every non-archive message in a channel hits this.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-22 17:16:09 +02:00
co-authored by Claude Sonnet 5
parent d8079c412a
commit 10f41feecb
3 changed files with 26 additions and 0 deletions
+8
View File
@@ -333,6 +333,14 @@ async function scanDestinationChannel(
fileSize: BigInt(doc.document.size),
date: new Date(msg.date * 1000),
});
} else if (doc?.file_name) {
// Not matched by any pattern in archive/detect.ts, so it is dropped without a
// packages/skipped_packages row. Grep "unrecognized attachment" to find naming
// schemes we do not handle yet.
log.debug(
{ chatId: chatId.toString(), messageId: msg.id, fileName: doc.file_name },
"Skipping unrecognized attachment (no archive/document pattern matched)"
);
}
}
+9
View File
@@ -267,6 +267,15 @@ export async function getChannelMessages(
});
continue;
}
if (doc?.file_name) {
// Not matched by any pattern in archive/detect.ts, so it is dropped without a
// packages/skipped_packages row. Grep "unrecognized attachment" to find naming
// schemes we do not handle yet.
log.debug(
{ chatId: chatId.toString(), messageId: msg.id, fileName: doc.file_name },
"Skipping unrecognized attachment (no archive/document pattern matched)"
);
}
// Check for photo messages (potential previews)
const photo = msg.content?.photo;
+9
View File
@@ -280,6 +280,15 @@ export async function getTopicMessages(
});
continue;
}
if (doc?.file_name) {
// Not matched by any pattern in archive/detect.ts, so it is dropped without a
// packages/skipped_packages row. Grep "unrecognized attachment" to find naming
// schemes we do not handle yet.
log.debug(
{ chatId: chatId.toString(), topicId: topicId.toString(), messageId: msg.id, fileName: doc.file_name },
"Skipping unrecognized attachment (no archive/document pattern matched)"
);
}
// Check for photo messages (potential previews)
const photo = msg.content?.photo;