| |
My Favorite Bugs: Invalid Surrogate Pairs
A collaborative editor built with TipTap and Yjs encountered a silent data loss bug where user edits would stop syncing when inserting certain emoji characters adjacent to each other. The root cause was that the CRDT library's splice operation was splitting surrogate pairs (the two 16-bit code units used in UTF-16 to represent emoji and other characters above U+FFFF) at the wrong byte offset, corrupting the data. The bug was exceptionally difficult to diagnose because it only occurred with specific multi-byte emoji in particular edit scenarios, leaving no error messages or stack traces.
Read Full Article →
← More Tech news