My Favorite Bugs: Invalid Surrogate Pairs

319 · George Mandis · May 14, 2026, 8:05 p.m.
Summary
The blog post by George Mandis recounts a challenging bug involving invalid surrogate pairs that occurred during the migration of a legacy editor to a collaborative experience. The issue caused users' typed changes to not save silently due to specific emoji combinations triggering an error in the underlying CRDT library. The author shares the diagnostic journey, technical vocabulary crucial to understanding the bug, and the eventual workaround and permanent fixes that were implemented. Key takeaways include the importance of recognizing encoding intricacies in JavaScript and the benefits of using the Intl.Segmenter for string manipulations.