Skip to content

Harden production route validation and persistence - #342

Merged
charlesrhoward merged 2 commits into
mainfrom
fix/prod-route-integrity
Aug 30, 2026
Merged

Harden production route validation and persistence#342
charlesrhoward merged 2 commits into
mainfrom
fix/prod-route-integrity

Conversation

@charlesrhoward

@charlesrhoward charlesrhoward commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reject malformed or injected route payloads and surface failed ownership or persistence checks instead of reporting success.
  • Make team invite acceptance a single transactional claim so concurrent callers cannot create ambiguous membership state.
  • Enforce request-wide attachment limits in Control chat.

Privacy and compatibility

No account-specific data or hosted-service diagnostics are included. Successful response shapes stay compatible; malformed input and backend failures now return explicit 4xx or 5xx responses. The invite transaction is added to both supported migration ledgers.

Verification

  • Full fast, unit, and database suites
  • Lint with zero errors
  • Production build
  • Focused unit, database migration, and type checks after rebasing onto current main

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@mogplex mogplex Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mogplex PR Review

Status: Attention needed

The route and persistence hardening is generally well-structured, and the atomic invite claim is backed by useful concurrency/rollback coverage. One correctness gap remains in Control chat attachment validation: malformed base64 payloads can still pass the new validator, so this needs changes before approval.

1 finding was added inline.

View check run

Comment thread app/api/control/chat/_lib/messages.ts
@mogplex

mogplex Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Mogplex PR Review

Status: No material issues found

Summary: The PR is approve-ready. Route payloads are allowlisted or structurally validated, persistence failures are surfaced instead of silently succeeding, and attachment limits are enforced across the full Control chat request.

Critical issues: None found.

Warnings: None found. The atomic invite migration is present in both migration ledgers and includes a row lock, transactional membership creation, single-use claiming, and restricted function execution. The added unit and database tests cover malformed input, backend failures, migration parity, and competing invite claimants.

Verdict: ✅ APPROVE — No material security, correctness, architecture, performance, or testing issues found in the submitted changes.

View check run

@charlesrhoward
charlesrhoward added this pull request to the merge queue Aug 30, 2026
Merged via the queue into main with commit bb0604f Aug 30, 2026
17 checks passed
@charlesrhoward
charlesrhoward deleted the fix/prod-route-integrity branch August 30, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant