Don't trust yourself, write automated tests.

It's been a rough week since I published this site, and I expected that someone would rely on it. A lot of things have been implemented, especially on the editor's side.

Two days ago, I asked one of my colleagues to write an article here. I thought everything would go smoothly, and he could publish his writing today. However, it turned out he encountered an issue while writing - his notes failed to save, and they're gone! I felt really bad about that. What could be the cause?

Previously, when you wrote a note here, it would automatically save on debounced input. It worked fine until it didn't. This issue arose after I published the new update on the editor. Previously, the editor only emitted plain markdown text, but after the update, it produced a lot more. Instead of just producing markdown text, the editor now produces the serialized editorState, which is a large object, and it also produces HTML markup for the snapshot.

The payload of the request became much bigger, and because I didn't perform proper tests, the user or my colleague had to endure a bad experience. It's frustrating!

The error was ERROR [ExceptionsHandler]: request entity too large because the default configuration of the framework I use, Nest.js, only allows a maximum body size of 100KB to be parsed. I don't know at which layer this 100KB limit is set; I hope it's not Express.js, which is the layer underneath. If it is, it's really problematic. Express.js is an unopinionated framework, but if it imposes a 100KB limit on its body parser, then there's an issue.

Anyway, it's my fault for not writing tests or conducting proper testing. It's regrettable, and I will do my best to ensure it doesn't happen again.