mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-09-21 05:21:43 +00:00
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:
@@ -333,6 +333,14 @@ async function scanDestinationChannel(
|
|||||||
fileSize: BigInt(doc.document.size),
|
fileSize: BigInt(doc.document.size),
|
||||||
date: new Date(msg.date * 1000),
|
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)"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,6 +267,15 @@ export async function getChannelMessages(
|
|||||||
});
|
});
|
||||||
continue;
|
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)
|
// Check for photo messages (potential previews)
|
||||||
const photo = msg.content?.photo;
|
const photo = msg.content?.photo;
|
||||||
|
|||||||
@@ -280,6 +280,15 @@ export async function getTopicMessages(
|
|||||||
});
|
});
|
||||||
continue;
|
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)
|
// Check for photo messages (potential previews)
|
||||||
const photo = msg.content?.photo;
|
const photo = msg.content?.photo;
|
||||||
|
|||||||
Reference in New Issue
Block a user