mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 03:13:41 +08:00
loadRecentFilesFromDisk now filters out files older than RECENT_FILE_TTL_MINUTES (60 min) so the disk fallback matches the Caffeine cache TTL and does not inject stale attachments into future conversations. Testability refactoring: - recentFileCache: private → package-private (tests can seed the cache directly) - chatUploadsRoot: new package-private Path field (tests redirect to @TempDir) - loadRecentFilesFromDisk: add (Path dir, long cutoffMs) package-private overload; private (String) wrapper delegates to it - injectRecentFiles: private → package-private New test class FeishuRecentFileCacheTest (14 cases): - loadRecentFilesFromDisk: non-existent dir, empty dir, fresh files sorted newest-first, stale files excluded by TTL, mixed fresh+stale, >5 files capped, timestamp-prefix stripping, MIME guessing from extension - injectRecentFiles: Caffeine cache hit, cache-miss disk fallback, empty disk, duplicate-path dedup, image vs file part typing, null textContent guard Relates to #325 |
||
|---|---|---|
| .. | ||
| src | ||
| Dockerfile | ||
| pom.xml | ||
| settings.xml | ||