Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-56] Android: Race condition in HTTPClient when invoking readystate callback

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:51:50.000+0000
Affected Version/sn/a
Fix Version/sRelease 0.6.0
ComponentsAndroid
Labelsandroid, fa_0_5_0
ReporterDon Thorp
AssigneeDon Thorp
Created2011-04-15T02:23:09.000+0000
Updated2011-04-17T01:51:50.000+0000

Description

A race condition exists where the readyState function invocations were being queued up by the WebViewCoreThread and only executing after readyState had been set to 4. So in normal usage patterns the code executed when the document was loaded was getting run 3 or 4 times depending on whether the callback was set before or after open.

Comments

  1. Don Thorp 2011-04-15

    (from [12a8718043d27d211b9d2ce399c5659388bb0a6b]) [#56 state:resolved] Extened logging to show thread name, added support for synchronus callbacks in TitaniumWebView. Added sync callbacks to HTTPClient to call handler synchronously. http://github.com/appcelerator/titanium_mobile/commit/12a8718043d27d211b9d2ce399c5659388bb0a6b"> http://github.com/appcelerator/titanium_mobile/commit/12a8718043d27...

JSON Source