Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

[HOTFIX] Remove draftjs block type validation in messages #4543

Merged
merged 3 commits into from
Jan 18, 2019

Conversation

mxstbr
Copy link
Contributor

@mxstbr mxstbr commented Jan 16, 2019

Status

  • WIP
  • Ready for review
  • Needs testing

Deploy after merge (delete what needn't be deployed)

  • api

This is confusing now that we have the plaintext input, and doesn't add anything as invalid blocks are treated as text blocks anyway on the frontend.

Going to hotfix ship this as it's breaking some users

This is confusing now that we have the plaintext input, and doesn't add
anything as invalid blocks are treated as text blocks anyway on the
frontend.
@spectrum-bot
Copy link

spectrum-bot bot commented Jan 16, 2019

Fails
🚫

These new files do not have Flow enabled:

  • api/utils/validate-draft-js-input.js

Generated by 🚫 dangerJS

});

throw new UserError(
'Please provide serialized raw DraftJS content state as content.body'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have a slightly different error message that's a bit more user-friendly, like "The chat input only accepts inline markdown and code blocks. It looks like you tried to post something else!"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Invalid block types (e.g. headings) will just be converted to text. Users will never see this after this PR, only folks who try to send invalid DraftJS content on purpose, so this is fine.

@brianlovin
Copy link
Contributor

@mxstbr looks like this just needs a small flow fix and then we can merge :)

@mxstbr mxstbr merged commit 342b8f7 into alpha Jan 18, 2019
@mxstbr mxstbr deleted the better-draft-js-validation branch January 18, 2019 07:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants