Skip to content

fix(messages): enforce shared payload validation for file messages (#335) - #525

Open
johdanike wants to merge 1 commit into
codebestia:mainfrom
johdanike:fix/file-message-validation
Open

fix(messages): enforce shared payload validation for file messages (#335)#525
johdanike wants to merge 1 commit into
codebestia:mainfrom
johdanike:fix/file-message-validation

Conversation

@johdanike

Copy link
Copy Markdown
Contributor

Summary

This PR resolves #335 by closing a validation gap in the file-message send path. Previously, send_file_message utilized weak, inline checks that entirely bypassed the envelope-presence rule. By routing file messages through our shared validator, we ensure absolute consistency across all message types.

Note: As requested, this PR is coupled with the envelope-migration updates so that file messages can successfully pass the newly enforced envelope rules.

Changes Made

  • Validation Consolidation: Updated the send_file_message handler to remove its custom inline checks and instead call the shared validateMessagePayload function used by the REST and socket send paths.
  • Envelope Enforcement: File messages are now strictly subjected to the envelope-presence rule.
  • Single Source of Truth: lib/validateMessagePayload.ts is now officially the singular validation checkpoint for every payload entering the send pipeline.
  • Migration Coupling: Integrated with the envelope-migration flow to ensure that send_file_message can actually process and create the required envelopes.

Acceptance Criteria Met

  • send_file_message calls the same validateMessagePayload the other send paths use.
  • Landed together with the envelope-migration issue to satisfy the file-type envelope rule.
  • lib/validateMessagePayload.ts remains the single source of truth for send-payload validity, referenced by every send path.

Closes #335

- Replaced weak inline validation in send_file_message with validateMessagePayload.
- Ensured file messages now strictly enforce the envelope-presence rule.
- Consolidated lib/validateMessagePayload.ts as the single source of truth for all send paths.
- Coupled changes with the envelope-migration updates to ensure proper envelope creation.

Closes codebestia#335
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@johdanike Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

content_type-specific validation on the file-message send path

1 participant