Commit Graph
13 Commits
Author SHA1 Message Date
choksi2212 dc579acc44 fix(org): clean up every site when deleting an org
deleteOrgById fetched the org's sites with .limit(1), so the per-site
cleanup loop ran for at most one site: the WireGuard deletePeer call,
the Newt terminate collection, and cleanupSiteAssociations were all
skipped for every other site in the org.

Drop the limit so every site is loaded, and mirror deleteSite.ts in the
loop: run cleanupSiteAssociations for newt sites so clients of other
orgs do not keep stale associations for the deleted sites.

Covered by a standalone regression test that seeds two wireguard and
two newt sites plus a stale association-cache row, runs deleteOrgById
against a stubbed exit node, and asserts all four sites were cleaned.
On the previous code the test fails with exactly the reported symptom:
one peer removal instead of two.

Fixes #3863
2026-10-13 06:52:56 +05:30
Owen 2cfd7e867b delete the client peers from the exit nodes properly 2026-08-04 15:46:22 -04:00
Owen d60c15b0ae Fix typo 2026-06-29 15:24:16 -04:00
Owen ff89a64453 Rename to limit id 2026-06-29 15:22:35 -04:00
Owen 4e2d88efdd Add some logging to debug 2026-03-11 11:42:28 -07:00
Owen 4975cabb2c Use native drizzle count 2026-03-11 11:42:28 -07:00
Owen 225591094f Clean up 2026-03-11 11:42:28 -07:00
Owen 82f88f2cd3 Reorder delete 2026-03-11 11:42:28 -07:00
Owen e2f78ba476 Merge branch 'main' of github.com:fosrl/pangolin into dev 2026-02-17 21:06:16 -08:00
Owen 719d2a5ffe Count everything when deleting the org 2026-02-17 20:39:47 -08:00
Owen 4d6240c987 Handle new usage tracking with multi org 2026-02-17 17:10:05 -08:00
miloschwartz 9eacefb155 support delete account 2026-02-14 22:44:30 -08:00
miloschwartz 33f0782f3a support delete account 2026-02-14 18:01:37 -08:00