Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24671] Windows: JS Callback in async should be done on UI thread

GitHub Issuen/a
TypeStory
PriorityMedium
StatusClosed
ResolutionDone
Resolution Date2017-05-24T22:29:16.000+0000
Affected Version/sRelease 6.1.0
Fix Version/sn/a
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2017-05-10T08:44:37.000+0000
Updated2017-06-06T11:03:52.000+0000

Description

We should make sure all JavaScript callback that is in async operation is done on UI thread. Otherwise we saw crash when callback touches UI properties especially on Windows Store apps. We haven't usually see this problem on Windows Phone apps. Typically we use TitaniumWindows::Utility::RunOnUIThread. It's going to look like below:
concurrency::create_task(object__->DoSomethingAsync()).then([]()({
    TitaniumWindows::Utility::RunOnUIThread([](){
        js_callback();
    });
})

Comments

  1. Kota Iguchi 2017-05-24

    Done with https://github.com/appcelerator/titanium_mobile_windows/pull/1001

JSON Source