The responseText variable can be truncated so some MessageEvents are not dispatched. In this case, append the lines which were not processed to the new responseText.