mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
Found and fixed multiple critical bugs with similar patterns: 1. routeStatements() used DELETE FROM d1_routes before re-inserting - Could cause data loss if interrupted or if logic changes - Now uses DELETE with WHERE clause + INSERT...ON CONFLICT (upsert) 2. saveFragments() used DELETE FROM d1_fragments before re-inserting - Same pattern as routes, fixed with targeted deletes + upsert - Added loadFragments() call to determine what to delete 3. adminGroupRename() didn't update fragment groupId - When renaming a group, fragments were left pointing to old groupId - Now updates fragments alongside routes, secrets, and invites All changes follow the same safe pattern: - Load existing data to identify what needs deletion - Delete only removed items with WHERE clauses - Use INSERT...ON CONFLICT DO UPDATE for upserts - Never use bare DELETE FROM table Testing: All 339 tests pass. |
||
|---|---|---|
| .. | ||
| lib | ||
| plugins | ||
| routes | ||
| tasks | ||
| error-handler.ts | ||