I left error reporting on notice level, and if the sql server has to reconnect it prints a notice, which isn't valid javascript, so it crapped itself.
Edit: And depending on the position of the error, it could have thrown it off later in the sync loop, so it's possible it was also the cause of the longass scrollback.