Cache Voicy transcription results by Telegram media #180

Merged
backmeupplz merged 1 commit from voi-kaneo-61-transcription-cache into main 2026-05-07 01:03:19 +00:00
backmeupplz commented 2026-05-07 00:40:50 +00:00 (Migrated from github.com)

Summary

  • add a Mongo-backed transcription result cache keyed by Telegram file_unique_id with file_id fallback and a configurable 10-day TTL
  • replay cached completed and empty/no-speech results through the existing final publisher before creating worker jobs
  • cache completed worker results after final publish succeeds while keeping cache write failures non-fatal
  • add focused cache proof coverage and update adjacent finalization/donation proofs

Validation

  • yarn build-ts
  • yarn lint
  • yarn test:transcription-cache
  • yarn test:transcription-finalization
  • yarn test:donation-wall
  • yarn test:error-empty-handling
  • yarn test:media-coverage
  • yarn test:silent-mode

Blocked locally:

  • yarn test:worker-api requires MONGO; workspace has no MONGO env configured

Manual QA Handoff

Recommended Telegram QA after deploy/test bot: send the same voice/audio media twice in a paid or otherwise allowed private chat and group. The first request should create one worker job and deliver the transcript; the second should return the cached final result immediately with no new worker job. Repeat with an empty/no-speech fixture and verify the second request uses the normal empty/no-speech behavior without a worker job. Also verify /silent still sends only the final transcript for non-empty audio and suppresses empty fallback as before.

Follow-up:

  • VOI-KANEO-62 was created for in-flight/concurrent duplicate request dedupe; this PR covers completed-result caching.
## Summary - add a Mongo-backed transcription result cache keyed by Telegram file_unique_id with file_id fallback and a configurable 10-day TTL - replay cached completed and empty/no-speech results through the existing final publisher before creating worker jobs - cache completed worker results after final publish succeeds while keeping cache write failures non-fatal - add focused cache proof coverage and update adjacent finalization/donation proofs ## Validation - yarn build-ts - yarn lint - yarn test:transcription-cache - yarn test:transcription-finalization - yarn test:donation-wall - yarn test:error-empty-handling - yarn test:media-coverage - yarn test:silent-mode Blocked locally: - yarn test:worker-api requires MONGO; workspace has no MONGO env configured ## Manual QA Handoff Recommended Telegram QA after deploy/test bot: send the same voice/audio media twice in a paid or otherwise allowed private chat and group. The first request should create one worker job and deliver the transcript; the second should return the cached final result immediately with no new worker job. Repeat with an empty/no-speech fixture and verify the second request uses the normal empty/no-speech behavior without a worker job. Also verify /silent still sends only the final transcript for non-empty audio and suppresses empty fallback as before. Follow-up: - VOI-KANEO-62 was created for in-flight/concurrent duplicate request dedupe; this PR covers completed-result caching.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
backmeupplz/voicy!180
No description provided.