-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Summary
When sending a message, users receive a confusing error message stating "Codec type is not registered" even when both and are properly registered. The actual issue is that the object is missing required properties ( and ). RemoteAttachment``RemoteAttachmentCodec``AttachmentCodec``RemoteAttachment``contentLength``filename
Current Behavior
- Error message: "Codec type is not registered"
- Users assume the codec registration is the problem
- The actual cause (missing required properties) is not communicated
Expected Behavior
- Clear, specific error message indicating which required properties are missing
- Error message should help developers understand the actual problem
Root Cause
The issue occurs when a is created without setting the required and properties. The codec fails during encoding/decoding, but the error handling incorrectly reports this as a codec registration issue rather than a validation/encoding failure. RemoteAttachment``contentLength``filename
Workaround
Ensure all required properties are set before sending:
val remoteAttachment = RemoteAttachment.from(
encryptedEncodedContent = contents[0].second,
url = URL(contents[0].first.assetUrl),
)
remoteAttachment.contentLength = attachment.data.size()
remoteAttachment.filename = attachment.filenameProposed Solution
- Improve error handling: Catch codec encoding failures and provide more specific error messages
- Add validation: Validate properties before attempting to encode
RemoteAttachment - Better error messages: Replace generic "Codec type is not registered" with specific validation errors
Metadata
Metadata
Assignees
Labels
No labels