clipwright/tests
juancarlos.cavero b4bf211b7b fix(cloud): close the gaps the account-deletion review turned up
Eight findings from re-reading the erasure path, each one something that would
have shown up in production rather than in a test:

- The local purge missed two stores. SaaSShorts outputs (output/saas_<id>) and
  generated thumbnails record ownership in their own in-memory dicts, not in
  the .owner file, so neither was erased. Thumbnails are the serious half: the
  hourly sweep deliberately skips their directory, so a deleted user's
  generated images stayed on disk forever, publicly served at /thumbnails/.
- The purge ran on the event loop. rmtree over gigabytes of video stalled every
  other request on the process; it goes through asyncio.to_thread now.
- Paths from those dicts are now resolved through _safe_under, so a session id
  or output_dir containing ".." deletes nothing.
- Deleting a user made a webhook path reachable that never was: _apply_topup
  takes the user id from Stripe metadata, so a top-up completing around the
  deletion inserted a row pointing at a user that no longer exists. The FK
  violation 500s the webhook, and since the event is only recorded after
  handle_event returns, Stripe retries the same doomed insert for three days.
  It confirms the row exists first.
- The "why are you leaving" box was free text stored in a record that
  deliberately outlives the account, which is how personal data ends up in one
  by accident. It is a closed list now, which also makes twenty deletions a
  month countable instead of readable.
- Two concurrent deletes wrote two erasure records and sent two goodbye emails.
  The DELETE's rowcount now decides which call is the real one; the UI holds a
  ref so a double click doesn't fire a second Stripe cancel and R2 purge.
- The delete button armed itself when the confirm box was empty, if the page
  ever rendered before /api/me resolved.
- The goodbye email claimed we keep "a one-way hash of your email and nothing
  else", which was not true of the Stripe reference beside it. Fixed in the
  email and in the privacy policy, EN and ES.

Also: skip the Upload-Post call when no managed key is configured, and say
plainly in the in-flight comment that it covers metered work only.

tests/test_account_local_purge.py covers tenant isolation across all three
stores and both traversal attempts; test_account_erasure.py gains the
confirmation gate, the API-key refusal, and the already-cancelled-at-Stripe
case that would otherwise trap a user forever.
2026-08-24 19:26:12 +02:00
..
conftest.py feat(agents): the pipeline as a platform — API keys, MCP server, webhooks 2026-08-03 22:33:16 +02:00
test_account_erasure.py fix(cloud): close the gaps the account-deletion review turned up 2026-08-24 19:26:12 +02:00
test_account_local_purge.py fix(cloud): close the gaps the account-deletion review turned up 2026-08-24 19:26:12 +02:00
test_active_speaker.py feat(reframe): optional layouts, and a Gemini-picked layout per video 2026-07-31 13:28:45 +02:00
test_alert_classify.py fix: reject too-short sources at submit and stop alerts blaming recovered downloads 2026-08-20 22:54:51 +02:00
test_api_keys.py feat(agents): the pipeline as a platform — API keys, MCP server, webhooks 2026-08-03 22:33:16 +02:00
test_billing_states.py fix(billing): stop stranding customers whose payment failed 2026-07-25 15:14:15 +02:00
test_camera_inset.py feat(reframe): layout for a screen with the camera composited into a corner 2026-07-31 13:28:45 +02:00
test_clip_ready_marker.py fix(dashboard): show each clip with its hook and captions as soon as it is done 2026-08-24 00:37:24 +02:00
test_clip_selection.py feat(generate): manual clip count and duration controls (discussion #65) 2026-08-18 19:21:42 +02:00
test_download_plan.py feat(download): flat-rate static ISP proxies before the per-GB proxy 2026-08-19 19:28:52 +02:00
test_edit_builder.py feat: karaoke subtitles, deterministic Auto-Edit v2, emoji hooks, retries (PR #50 block 1) 2026-07-17 21:26:04 +02:00
test_email_policy.py fix(auth): harden MX verification after code review 2026-08-13 10:07:20 +02:00
test_ffmpeg_utils.py feat(clips): borrar la metadata heredada del source en los clips finales 2026-07-23 01:34:59 +02:00
test_filename_limits.py fix(clips): precompose accented titles so the file name survives a fetch() 2026-08-24 00:15:08 +02:00
test_gemini_retry.py fix(gemini): distinguir bloqueo de contenido de fallo transitorio 2026-07-24 00:37:14 +02:00
test_generation_controls.py feat(generate): manual clip count and duration controls (discussion #65) 2026-08-18 19:21:42 +02:00
test_hook_layers.py test(hook): styles contract, bitmap-emoji scaling, layer walk-back 2026-08-19 16:22:38 +02:00
test_hooks.py test(hook): styles contract, bitmap-emoji scaling, layer walk-back 2026-08-19 16:22:38 +02:00
test_job_error_text.py test(ci): saltar los tests que importan main/app en el CI mínimo 2026-07-23 11:40:05 +02:00
test_layout_picker.py feat(layout): shadow mode, decide and log without touching the render 2026-08-01 01:58:19 +02:00
test_log_view.py feat(cloud): user-friendly job logs + transcription progress; hide auto profile id in header 2026-07-18 02:20:31 +02:00
test_mcp_endpoint.py fix(test): pin a dummy Gemini key so the webhook SSRF test runs the SSRF branch in CI 2026-08-04 00:09:03 +02:00
test_mcp_protocol.py feat(mcp): list_clips renders as an MCP App clip picker in UI-capable clients 2026-08-05 23:59:02 +02:00
test_mcp_ui.py feat(mcp): list_clips renders as an MCP App clip picker in UI-capable clients 2026-08-05 23:59:02 +02:00
test_metering_free_plan.py feat(abuse): abrir free a email normal + bloquear dominios desechables 2026-07-21 00:45:54 +02:00
test_panel_layout.py fix(panel): a 2x2 grid for three people, not three bands 2026-07-31 14:24:46 +02:00
test_probe_plan.py fix(proxy): probe the duration over the static pool, not the per-GB proxy 2026-08-21 22:45:53 +02:00
test_process_handover.py feat: hand the Thumbnail Studio video and transcript straight to the clip generator 2026-08-20 19:48:13 +02:00
test_proxy_watch.py feat(download): flat-rate static ISP proxies before the per-GB proxy 2026-08-19 19:28:52 +02:00
test_punch_in.py feat(reframe): optional layouts, and a Gemini-picked layout per video 2026-07-31 13:28:45 +02:00
test_recut.py fix(recut): virtual_transcript must keep Whisper's word-boundary spaces 2026-08-19 12:22:39 +02:00
test_reframe_endpoint.py fix(reframe): harden PR #70's manual reframing after review 2026-08-19 12:09:02 +02:00
test_reframe_v2.py feat(clips): four quality fixes found by auditing real user output 2026-07-26 20:59:04 +02:00
test_rerender_endpoint.py test(edl): pin the full-transcript contract with words outside the old window 2026-08-20 13:36:13 +02:00
test_screencast_layout.py feat(reframe): optional layouts, and a Gemini-picked layout per video 2026-07-31 13:28:45 +02:00
test_short_source_gate.py fix: reject too-short sources at submit and stop alerts blaming recovered downloads 2026-08-20 22:54:51 +02:00
test_social_tenant_isolation.py harden(social): fail closed when the server cannot resolve the caller's profile 2026-08-21 21:19:44 +02:00
test_speaker_tracker.py fix(reframe): ignore lone target jumps so the camera stops swinging 2026-07-26 20:59:04 +02:00
test_split_layout.py feat(reframe): optional layouts, and a Gemini-picked layout per video 2026-07-31 13:28:45 +02:00
test_subtitle_metering.py fix(subtitles): stop charging quota for burning captions 2026-07-25 17:16:59 +02:00
test_subtitles.py fix(captions): keep apostrophes out of the burned subtitle path 2026-07-29 15:04:50 +02:00
test_transcribe_backends.py fix(transcribe): manejar vídeos sin audio + alerta de fallos honesta 2026-07-21 21:13:59 +02:00
test_translate.py feat: karaoke subtitles, deterministic Auto-Edit v2, emoji hooks, retries (PR #50 block 1) 2026-07-17 21:26:04 +02:00