deleteOrg.childTest.ts read its leftover counts with db.get(sql...), a better-sqlite3 driver method. The pg config type-checks the same file with the pg driver's types, where .get() does not exist, so build-postgres failed on PR #3895's head (TS2339 at deleteOrg.childTest.ts:108) and main has carried the break since the merge landed 40 seconds before the job reported red. Read the counts through the query builder instead - the same .select({ count: count() }) shape deleteOrg.ts itself uses, which compiles under both configs - keeping the observations JSON the parent test parses unchanged.
Signed-off-by: Manas Choksi <12302040701105@mbit.edu.in>
Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
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
Resolves#1408.
A rule with match "METHOD" carries a comma-separated list of HTTP
methods in its value, e.g. "POST,PUT", and applies when the request
method is in that list. This makes it possible to leave GET public
while sending POST and PUT to auth, which rules could not express
before because both share the same path.
No new columns: the methods live in the existing rule value, so this
needs no migration and every existing rule keeps working unchanged.
The UI offers the ten registered methods. Blueprints and the API
accept any method token, so extension methods such as the WebDAV verbs
can be targeted too, and the UI preserves them when a rule set that
way is edited later.