Commit Graph
19 Commits
Author SHA1 Message Date
Francis Cao b7084bb90a Merge branch 'dev' into fix/delete-cascade 2026-05-07 13:58:29 -07:00
Francis Cao 5ccfb6d0a5 implement datatable sorting on non-analytics tables. (website/board/link/pixel/team/admin) 2026-05-07 10:46:03 -07:00
Stanislaw 71ee000f21 fix: avoid restamping deletedAt + skip Redis DEL for already-soft-deleted slugs
Address Greptile review feedback on #4243.

- Cloud-mode link.updateMany / pixel.updateMany now filter where: { ..., deletedAt: null } so a previously soft-deleted row keeps its original deletion timestamp instead of being restamped with the current time.
- Pre-transaction findMany now selects deletedAt; the Redis invalidation list filters to only live slugs, avoiding harmless but wasted DEL calls for already-soft-deleted entries.

Note: the share.deleteMany cleanup still uses the broad entityId list (not filtered by deletedAt) so that orphan share rows of already-soft-deleted links/pixels are still cleaned up. Filtering the prefetch itself, as Greptile's exact suggestion proposed, would skip those shares while link.deleteMany still hard-deletes the rows, leaving orphan share rows behind. Verified empirically with a 3-scenario reproduction.
2026-05-07 04:14:38 +02:00
Stanislaw a57abbe039 fix: clean up link, pixel, board rows on user/team deletion
deleteUser and deleteTeam left link/pixel/board rows (and their share rows)
in the database after the owner was removed. /q/<slug> and /p/<slug>
also kept serving deleted entries because the routes did not filter
deletedAt and Redis cached lookups for 24h.

- deleteUser: clean up link/pixel/board + shares for the deleted user.
  Cloud mode: soft-delete link/pixel, hard-delete board, only userId-owned.
  Non-cloud: hard-delete everything matching userId or owned teamIds.
- deleteTeam: same cleanup, scoped to teamId.
- /q and /p route handlers: filter deletedAt: null at the call sites
  (not in findLink/findPixel helpers, which would null-deref the
  permission checks at src/permissions/link.ts and pixel.ts).
- Post-transaction Redis invalidation mirrors deleteWebsite.
2026-05-07 03:37:22 +02:00
Francis Cao cd2b303e89 use team redis keys to resolve team gated features 2026-03-21 11:21:07 -07:00
Mike Cao fa8d8055df Reformatted files with biome. 2025-11-22 22:42:42 -08:00
Mike Cao f70f98fed0 Updated replica handling. Fixed types. 2025-10-03 01:20:48 -07:00
Mike Cao 1b400da7b2 Fixed share page. Updated device detect. Updated teams fetch. 2025-09-25 11:21:44 -07:00
Mike Cao f40e1b44f3 Updates for cloud mode. 2025-09-04 20:27:42 -07:00
Mike Cao 56af91950a Updated components build. 2025-09-01 15:59:06 -07:00
Mike Cao d130242a0a Pixel editing. 2025-08-15 13:04:13 -07:00
Mike Cao 88639dfe83 New schema for pixels and links. 2025-08-13 20:27:54 -07:00
Mike Cao bf6c9395c6 Revert Prisma build. 2025-07-12 15:18:01 -07:00
Mike Cao ee6c68d27c Refactor filter handling for queries. 2025-07-02 01:44:12 -07:00
Mike Cao a1654e88af Update CI. 2025-06-18 22:46:05 -07:00
Mike Cao 49bcbfd7f9 New goals page. Upgraded prisma. 2025-05-31 02:11:18 -07:00
Mike Cao f48ca7f77a More search fixes. 2025-02-11 05:41:50 -08:00
Mike Cao 8525188e42 Changed import path. 2025-02-05 15:59:59 -08:00
Mike Cao db36c37d32 Updated session and events queries. Added sessions page. 2024-07-08 01:45:54 -07:00