Skip to content

DRY: extract shared signed-URL session cache (duplicated in AttachmentSync/RecordingSync) #381

Description

@NesiciCoding

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions