Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27320] iOS: Ti.Stream.writeStream fires callback for each loop of writes, no way to tell when done

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 8.2.0
Fix Version/sn/a
ComponentsiOS
LabelsengSchedule
ReporterChristopher Williams
AssigneeAbir Mukherjee
Created2019-08-08T14:55:35.000+0000
Updated2020-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.

Comments

No comments

JSON Source