No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!116
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/m2-p1-batch-92-93-94"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three M1-closure-audit P1 fixes (#84 umbrella), TDD RED->GREEN, 8 new tests:
#92 — /root/contents diverged from /root (B-7 flag missing in sibling)
GetRootFolderContents picked ANY ParentFolderId==null folder (no filter, no order) and auto-created without IsTenantRoot=true — a tenant with a personal root-level folder + canonical root got nondeterministic contents; uploads landed in a different folder than listings served. Fix: new TenantRootFolderResolver (flagged root -> promote earliest pre-flag root -> create flagged) shared by BOTH endpoints — divergence is now structurally impossible.
#93 — org approve could strand a request Approved with no tenant; retry impossible
The status flip committed FIRST, then slug generation could 409 (exhaustion) or SaveChanges could conflict — leaving the request Approved, the founder pointing at a tenant with no Owner row, and a retry hitting 'already decided'. Fix: one transaction around flip + slug + tenant + founder + membership + audit; any failure rolls the flip back (request stays Pending, retry genuinely retries). Audit moved inside the tx (an audit throw no longer 500s a committed approval). Notifications/email remain post-commit best-effort. Tests: slug-exhaustion (101 occupied slugs -> 409 with request still Pending, founder untouched) + injected mid-transaction save failure (AuditService decorator, fires once -> 409 -> retry succeeds end-to-end).
#94 — public /token/ matched short codes and leaked invitee email
The OR clause defeated the endpoint's own full-token-only contract; anyone holding the short code (travels in emails/admin lists) got the invitee Email. Fix: drop the ShortCode clause; /code/ keeps the PII-free preview (guard test included).
Also: AuditService.LogAsync made virtual (test seam). Suite 927/0/39 (Release+Debug) locally. Closes #92, closes #93, closes #94.