Repository navigation
Description
The dedup query selects only the newest organization-wide URL match, then checks its thread afterward. The B job hides the older eligible A job, so the third paste creates a new job in A.
Reproduced at 480ee6a3e6d33c3414a2c0f8a52fded1ddc4ca2d. Suggested severity: P2.
Reproduction
- Open two existing chats A and B in the same organization, as the same member.
- Paste a supported video URL in A, then paste the identical URL in B before either job completes.
- Return to A and paste that URL again. Inspect its unsent video chips or GET /api/app/video-links/thread/.
Expected: Chat A keeps its original unsent job for that normalized URL. Activity in another chat should not disable current-chat deduplication.
Actual: The dedup query selects only the newest organization-wide URL match, then checks its thread afterward. The B job hides the older eligible A job, so the third paste creates a new job in A.
Impact: The same composer receives duplicate unsent video attachments and redundant extraction jobs. This also consumes the organization's three-job processing cap without adding another video.
Evidence and controls
Three actual native ingest requests returned 200 and three distinct job IDs. PostgreSQL and the native list route showed two queued unsent jobs for the identical URL in A; the queue sink recorded three video.ingest enqueues.
Executed from /Users/yannick/.codex/notes/tale-1000-additional/worktree:
/Users/yannick/.npm/_npx/22f2fe8d8bc13000/node_modules/.bin/bun x --no-install vitest run --config /Users/yannick/.codex/notes/tale-1000-additional/video-wave01/native-batch1.vitest.config.ts --maxWorkers=1 --reporter=verbose --silent=falseObserved 6 passed (6), exit 0, in 25.39 seconds. Frozen proof: native-batch1.test.ts, native-batch1.vitest.config.ts and native-batch1.log.
- Consecutive A/A tracking/fragment variants return one ID, update the pasted token and enqueue exactly once.
- The A/B path uses two genuinely owned distinct thread rows and native membership/ownership checks; the test does not substitute a dedup result.
- Empty, oversized and playlist inputs are rejected before enqueue.
Source
Scope and deduplication
- Actual Hono video routes, session/org membership and own-thread guards, video service SQL, ingest worker, video-specific shim, caption parser, paragraphizer and native file/job finalizer execute. Every rerun creates a fresh retained PostgreSQL database on the assigned loopback cluster. The video table and its checks come directly from the pinned production migration; supporting identity/thread/file tables contain the columns these paths use. This is not a full production-schema test.
- Metadata/caption download boundaries are controlled synthetic local fixtures. Native URL validation runs with a deterministic DNS resolver; global fetch refuses all network. The metadata shape is the current YtDlpMetadata contract, and the caption bytes are a normal blank-line-delimited WebVTT track with valid cue timings/voice tags. No real media, yt-dlp process, ffmpeg, provider, browser-source page or model is called.
- Queue and realtime outbox sinks record calls; unrelated budget/rate-limit/2FA decisions are permissive fixtures. Audit writes, browser-session pool and unrelated chat/RAG tool handlers are omitted. Blob writes retain local bytes; the native transcript metadata and job status are committed in PostgreSQL. No indexing result, live provider outcome or production defect reproduction is claimed.
- All identities, databases and files are new retained fixtures. No existing state is reset or deleted, no source file is edited and no credentials are logged. Browser verification is pending/unavailable and does not support this batch. An initial harness run lacked an unused knowledge shim export; its working log is retained and excluded as product evidence.
- Searched all 1028 cached all-state issue bodies and baseline 102/current wave ledger for video deduplication, duplicate jobs, source_url_hash and in-thread dedup. The only broad-regex hit was Bug: Duplicate customers can be created due to case-sensitive email validation #690 (customer e-mail casing); its body's unrelated demonstration video link is not this feature.
- The explicit welcome-page two-tab exception does not apply: this reproducer supplies two existing thread IDs. No matching current report or documented debt was found. Search details are frozen in dedup-batch1.json.
Independent review
Independently read the real SQL and complete fixture, replayed all six native cases against a new retained DB. A/B/A produced two queued jobs in A; consecutive normalized A/A reused one job. Full-body live dedup found no matching report. First parent run timed out during fixture setup; the replay with a longer setup ceiling passed all six cases.
The affected source files are unchanged between the tested revision and current main d351611bd as checked before publication. Checked all-state issue bodies and the separate baseline of 102 reports; this entry is additional to that baseline.
Activity