E2E: empty tables with TRUNCATE so full-text indexes keep matching #163

Merged
miko merged 1 commit from fix/e2e-reset-truncate into development 2026-11-10 14:43:22 +01:00
Owner

Summary

 resetDatabase
   SET FOREIGN_KEY_CHECKS = 0
   for each table but _prisma_migrations
-    DELETE FROM table
+    TRUNCATE TABLE table      # rebuilds full-text indexes

Emptying the tables with DELETE run after run left the Page full-text index in kataba_e2e matching nothing: the stored search text was right, but even a freshly inserted row wasn't found, while a new table in the same database matched fine. TRUNCATE rebuilds the index. The app is not affected; it never empties tables, and page search works in the dev database.

Evidence

  • Before: pages.spec.ts:127 "search finds pages only for those who may see them" and pages.spec.ts:333 "…search finds their text" fail with "Nothing found"; 92/94 passed.
    After: full e2e suite, 95 passed.

Merge Danger

Door: two-way

Blast Radius: none — test setup only.

🤖 Generated with Claude Code

## Summary ```diff resetDatabase SET FOREIGN_KEY_CHECKS = 0 for each table but _prisma_migrations - DELETE FROM table + TRUNCATE TABLE table # rebuilds full-text indexes ``` Emptying the tables with `DELETE` run after run left the `Page` full-text index in `kataba_e2e` matching nothing: the stored search text was right, but even a freshly inserted row wasn't found, while a new table in the same database matched fine. `TRUNCATE` rebuilds the index. The app is not affected; it never empties tables, and page search works in the dev database. ## Evidence - **Before:** `pages.spec.ts:127` "search finds pages only for those who may see them" and `pages.spec.ts:333` "…search finds their text" fail with "Nothing found"; 92/94 passed. **After:** full e2e suite, 95 passed. ## Merge Danger **Door:** two-way **Blast Radius:** none — test setup only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Emptying them with DELETE run after run left the Page full-text index
matching nothing, so both page search tests failed. TRUNCATE rebuilds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit bfffc9a082 into development 2026-11-10 14:43:22 +01:00
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
MassiveDynamic/kataba!163
No description provided.