Central Station / YPM-BUG-PASTE-ALERT-DETECTION-BROKEN

Paste alert detection broken

bugs/paste-alert-detection-broken.md · Updated 2026-04-29
GET /api/tickets/YPM-BUG-PASTE-ALERT-DETECTION-BROKEN

Summary

E2E test skipped; broke after Phase 1 editor refactor

0Questions 0Links 0Comments 0PRs
Spec body Markdown
# Paste alert detection broken

Paste-alert detection in the document editor stopped firing after the Phase 1 editor refactor. The e2e test that covered it is currently skipped.

## Reproduction

1. As a student, open a document.
2. Copy a large block of text (>200 chars) from another source.
3. Paste it into the document editor.

## Expected

A paste alert is recorded against the document and surfaced to the teacher in the grading view.

## Actual

No alert is recorded. The teacher sees no indication of the paste.

## Impact

Teachers rely on paste alerts to flag potentially copied work. The signal has been silently absent since the Phase 1 editor refactor — meaning recent submissions may have unflagged paste activity that should have been caught.

Severity is medium rather than high because:
- It's a detection feature, not a correctness feature; nothing else breaks.
- Teachers still have the broader visibility into student writing patterns.
But it should be fixed before more pilot rollout, since it's a feature the UA professor specifically asked about.

## Affected versions

Broke during the Phase 1 editor refactor in `yawp-2.0`. Specific commit/branch reference TBD — engineering should bisect.

## Suspected cause

The clipboard event handling in the editor's input layer was rewritten during Phase 1. The paste-alert hook likely either (a) is no longer attached to the new event source, or (b) fires but the recording side dropped its listener.

Files to start investigating:
- `services/web-app/app/components/editor/...` (Phase 1 editor refactor target)
- `services/web-app/app/lib/paste-alerts/...` (recording side)
- The currently skipped e2e test — find it and the skip annotation will name the file path and probably the failure mode.

## Workaround

None. Teachers can review documents manually but there's no automated flag.
Repo sync Not recorded

No repo sync metadata recorded yet.