Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decoding messages #191

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Fix decoding messages #191

merged 2 commits into from
Dec 20, 2023

Conversation

nplasterer
Copy link
Contributor

@nplasterer nplasterer commented Dec 20, 2023

When sending a text message with an empty string the app would error as the string was considered falsy since it was empty. We now handle all text messages as they are supported by default.

In this process I also caught that custom content types would break on decode because the codec did not exist. We now error gracefully for unsupported content types allowing for the handling of them in app.

Screenshot 2023-12-20 at 11 34 03 AM

@nplasterer nplasterer self-assigned this Dec 20, 2023
@nplasterer nplasterer requested a review from a team as a code owner December 20, 2023 19:39
throw new Error(
`no content type found ${JSON.stringify(this.contentTypeId)}`
)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix for custom content types.

if ('contentKey' in codec && this.nativeContent[codec.contentKey]) {
if (
('contentKey' in codec && this.nativeContent[codec.contentKey]) ||
this.nativeContent.hasOwnProperty('text')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Text is always a supported content type.

@nplasterer nplasterer merged commit 3c14dfc into main Dec 20, 2023
4 of 5 checks passed
@nplasterer nplasterer deleted the np/fix-decoding-empty-messages branch December 20, 2023 19:42
Copy link
Contributor

🎉 This PR is included in version 1.23.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants