[TIMOB-27320] iOS: Ti.Stream.writeStream fires callback for each loop of writes, no way to tell when done
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 8.2.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | engSchedule |
Reporter | Christopher Williams |
Assignee | Abir Mukherjee |
Created | 2019-08-08T14:55:35.000+0000 |
Updated | 2020-11-23T18:05:13.000+0000 |
Description
Ti.Stream.writeStream behaves differently on iOS vs Android. Android will do all of the writes and will fire the callback once at the end (or will fire it as soon as an error occurs).
iOS will fire if an error occurs; or every iteration of it's internal read/write loop and at then at the end. But there's no way to know beforehand if it is done unless you know the exact byte count expected to be transferred. (The case I specifically saw was a Ti.File.FileStream and copying it's data)
As a first step, adding a "done" property to the callback's argument object would be useful so you can tell when iOS is actually finished. A second step would be to eliminate the per-loop callback firing altogether for iOS.
No comments