Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another fun bug report: I entered lots of input, and the page suddenly went blank. In the console:

  Error: code length overflow. (28252>23648)
So yeah, seems like all you have to do is paste 24KB of data in and it blows up. :)

I see this failure mode in React apps a lot, where a bug causes an exception to be thrown, and the page just vanishes in a puff of smoke, as though it never was.

Half the time I’ve seen this failure mode it’s also been combined with persisting the bad value, so that the site is permanently broken until you can unpersist the value (e.g. clear localStorage or IndexedDB or cookie; but if the bad value is stored on a server you’re truly stuck).

The impression I’ve taken away is that it’s entirely unacceptable for a React component to throw an exception, because it will immediately destroy everything. Wonder how common such failures actually are, and whether there’s anything React itself could do about it (my guess is not).



Thanks, fixed. TIL ssids have a max char count of 32:

https://serverfault.com/questions/45439/what-is-the-maximum-...


FYI, maxlength is actually not enough to protect against people like me that are determined to break things for fun: Firefox 77 starts letting you exceed maxlength if pasting text in, to protect against accidental truncation. See https://www.fxsitecompat.dev/en-CA/docs/2020/text-exceeding-....

You may say it’s a fairly contrived failure, but it’s easily possible, and plausible if the user thinks they copied the password onto the clipboard, but actually those paragraphs of text they copied earlier are still on the clipboard. That sort of thing happens to people that use the clipboard (e.g. me) not uncommonly.


All good. This was a random weekend hack project meant to solve a specific, personal need. Figured I'd share it out in case others were interested.

I'm glad it's sparked your curiosity but I hope you'll understand the intent. I'd be happy to accept PR's if you'd like to contribute!


Who cares that you're "determined" to break the client for yourself?

It's like bragging that you can inspect element to change your bank balance.


This is what React error boundaries are for, containing the exception and optionally showing a fallback or error.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: