Over-engineering / DRY (ponytail-audit finding)
The signed-URL session cache — the CachedUrl interface plus getCachedUrl / setCachedUrl (~28 lines) — is duplicated byte-for-byte across two files. The only difference is the sessionStorage key prefix.
Duplicated in
src/services/database/AttachmentSync.ts (lines 7–32, prefix rm_signed_url_)
src/services/database/RecordingSync.ts (lines 8–32, prefix rm_signed_url_rec_)
Fix
Extract src/services/database/signedUrlCache.ts exporting getCachedSignedUrl(key) / setCachedSignedUrl(key, url) (keep the 55-min TTL constant there). Have both sync classes pass their own prefixed key. Net ~-28 lines.
Scope: complexity cleanup only, not a bug.
Over-engineering / DRY (ponytail-audit finding)
The signed-URL session cache — the
CachedUrlinterface plusgetCachedUrl/setCachedUrl(~28 lines) — is duplicated byte-for-byte across two files. The only difference is thesessionStoragekey prefix.Duplicated in
src/services/database/AttachmentSync.ts(lines 7–32, prefixrm_signed_url_)src/services/database/RecordingSync.ts(lines 8–32, prefixrm_signed_url_rec_)Fix
Extract
src/services/database/signedUrlCache.tsexportinggetCachedSignedUrl(key)/setCachedSignedUrl(key, url)(keep the 55-min TTL constant there). Have both sync classes pass their own prefixed key. Net ~-28 lines.Scope: complexity cleanup only, not a bug.