fix(messages): enforce shared payload validation for file messages (#335) - #525
Open
johdanike wants to merge 1 commit into
Open
fix(messages): enforce shared payload validation for file messages (#335)#525johdanike wants to merge 1 commit into
johdanike wants to merge 1 commit into
Conversation
- 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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves #335 by closing a validation gap in the file-message send path. Previously,
send_file_messageutilized 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
send_file_messagehandler to remove its custom inline checks and instead call the sharedvalidateMessagePayloadfunction used by the REST and socket send paths.lib/validateMessagePayload.tsis now officially the singular validation checkpoint for every payload entering the send pipeline.send_file_messagecan actually process and create the required envelopes.Acceptance Criteria Met
send_file_messagecalls the samevalidateMessagePayloadthe other send paths use.lib/validateMessagePayload.tsremains the single source of truth for send-payload validity, referenced by every send path.Closes #335