sanity-io / sanity

Sanity Studio – Rapidly configure content workspaces powered by structured content
https://www.sanity.io
MIT License
5.07k stars 411 forks source link

[studio] Emoji in string field sometimes crashes document #1643

Closed mrkolby closed 1 year ago

mrkolby commented 4 years ago

Describe the bug

After creating hundreds of documents this week we learned that you need to add emojis after you are done writing in a string field - for example a title - to avoid having the document crashing and producing «We're sorry, but your changes could not be applied».

To Reproduce

  1. Add one or several emojis in a string field and continue writing.
  2. See error: We're sorry, but your changes could not be applied

Expected behavior

Not crash. Show funny emojis.

Screenshots

sanityio-emoji-crash

Which versions of Sanity are you using?

@sanity/cli                0.146.0 (up to date)
@sanity/base               0.146.3 (up to date)
@sanity/components         0.146.3 (up to date)
@sanity/core               0.146.0 (up to date)
@sanity/default-layout     0.146.3 (up to date)
@sanity/default-login      0.146.0 (up to date)
@sanity/desk-tool          0.146.3 (up to date)
@sanity/google-maps-input  0.146.3 (up to date)
@sanity/vision             0.146.3 (up to date)

What operating system are you using?

macOS Catalina 10.15.1

Which versions of Node.js / npm are you running?

6.13.1
v13.2.0

Additional context

Screenshot is from a clean sanity init with the optional Movie project (schema).

vicmeow commented 4 years ago

Thanks for reporting! This is bug in diff-match-patch from google reported here https://github.com/google/diff-match-patch/issues/59 and here’s a PR from us to fix it: https://github.com/google/diff-match-patch/pull/69. I’m not sure what the status on this is tho! But will look into it 😊

Edit: looks like there’s a new PR: https://github.com/google/diff-match-patch/pull/80

dmsnell commented 4 years ago

For what it's worth we have updated Simplenote to use the patch in google/diff-match-patch#80 and it seems to working just fine for us. That's an incomplete patch because some language environments aren't fixed and there is one lingering big issue (diff-match-patch doesn't specify an encoding or guarantee that a library in Lua will work with a library in JS)

I'd be happy to have y'all test it out and let me know if something unexpectedly breaks with it. Hopefully we can get this merged into the library but I don't know when the maintainers will have a chance to interact with it.

dmsnell commented 4 years ago

Just an update, in case you end up using google/diff-match-patch#80 - we found some breaking cases and I'm in the process of handling them. please follow the discussion in that PR before merging into your project 😉

MikeCastillo1 commented 3 years ago

This issue is still happening at the latest version

@sanity/cli version 1.150.7 "@sanity/base": "^1.150.8",

Also this happens with text type.

kmelve commented 1 year ago

Hi!

We are currently working on improving our workflows and follow-up on our open GitHub repository. In that work, we have decided to close most issues older than the release of Sanity Studio v3.

We value your feedback, so if this issue is still important to you and relevant for Sanity Studio v3, please search for relevant open issues. If you can’t find any, open a new one and link to relevant comments in this thread. For questions about how to do something, please post them in the slack community.