Files
pangolin/server/lib
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
..
2026-08-04 10:15:49 -04:00
2026-09-14 18:05:30 -04:00
2026-08-17 12:00:12 -04:00
2025-12-20 12:16:31 -05:00
2026-08-17 12:00:12 -04:00
2025-10-27 10:43:44 -07:00
2025-12-09 10:56:14 -05:00
2026-08-11 12:19:28 -04:00
2025-10-04 18:36:44 -07:00
2026-09-29 11:02:37 -04:00
2025-10-10 11:27:15 -07:00
2026-09-14 16:48:07 -04:00
2025-12-09 10:56:14 -05:00
2026-09-15 10:56:39 -04:00
2025-08-14 17:06:07 -07:00
2025-12-09 10:56:14 -05:00
2026-07-01 21:13:40 -04:00
2026-04-15 14:41:13 -07:00
2026-07-03 09:02:08 -04:00
2025-12-09 10:56:14 -05:00
2026-09-14 16:48:10 -04:00
2025-12-09 10:56:14 -05:00
2026-04-15 14:41:13 -07:00
2026-04-23 14:05:08 -07:00
2025-12-09 10:56:14 -05:00
2026-02-25 16:04:47 -08:00
2026-07-29 17:45:19 -04:00
2025-12-09 10:56:14 -05:00
2026-04-15 14:41:13 -07:00
2025-07-13 21:58:37 -07:00