EventSource
EventSource copied to clipboard
Received data splits if is too long
Extracted from https://github.com/neilco/EventSource/issues/9#issuecomment-294306741
My server returns data in single line. But if it is very large (a few dozen screens if use line-breaks, I may measure if needed), looks like URLSession calls didReceiveData with parts of payload. I found it here. So payload just comes broken.
@neilco Thank you for pointing how to fix this, but I'm afraid I can't – I just don't know ObjC. I guess there should be some data concatenation and end detection logic implemented as well.