Summary
test_unbound_user_cannot_send_message fails on the clean default-branch state because the API returns 404 RecordNotFound, while the integration contract expects HTTP 400.
Steps to reproduce
- Apply all migrations to an empty PostgreSQL database.
- Create a private stream and bind it only to user B.
- Create a topic in that stream.
- Authenticate as unbound user A.
- Send
POST /api/messenger/v1/messages/ with the stream UUID, topic UUID, and a valid Markdown payload.
Expected result
The request is rejected with HTTP 400, as asserted by the existing integration test.
Actual result
The request is rejected with HTTP 404. The response type is RecordNotFound, reporting that no visible WorkspaceUserStream row exists for user A.
Reproduction evidence
- Reproduced on clean commit
77a5b35.
- Reproduced independently in an isolated local test environment with PostgreSQL 18.4 and Python 3.14.
- The focused test result is
1 failed; no application changes are required to trigger it.
Impact
The integration suite is red on a clean checkout, and the intended public error-status contract for an unbound sender is ambiguous.
Notes
Observed fact: visibility lookup raises RecordNotFound, which the error middleware maps to 404.
Hypothesis: either the test's expected status is stale, or message creation should translate this visibility failure into a validation error. The desired contract should be selected explicitly before changing code or the test.
Summary
test_unbound_user_cannot_send_messagefails on the clean default-branch state because the API returns404 RecordNotFound, while the integration contract expects HTTP 400.Steps to reproduce
POST /api/messenger/v1/messages/with the stream UUID, topic UUID, and a valid Markdown payload.Expected result
The request is rejected with HTTP 400, as asserted by the existing integration test.
Actual result
The request is rejected with HTTP 404. The response type is
RecordNotFound, reporting that no visibleWorkspaceUserStreamrow exists for user A.Reproduction evidence
77a5b35.1 failed; no application changes are required to trigger it.Impact
The integration suite is red on a clean checkout, and the intended public error-status contract for an unbound sender is ambiguous.
Notes
Observed fact: visibility lookup raises
RecordNotFound, which the error middleware maps to 404.Hypothesis: either the test's expected status is stale, or message creation should translate this visibility failure into a validation error. The desired contract should be selected explicitly before changing code or the test.