Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any dependency to the
TI_USE_KROLL_THREAD
, did you test it with both<run-on-mainthread/>
and without? Just want to double-check.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually when we run on Studio the JS is executed in a separate thread.
<run-on-mainthread/>
is false by default. But the permission are required to be presented on main thread.But when we run in XCode
TI_USE_KROLL_THREAD
is not defined, which makes JS run on main thread. So it very easy to miss on background thread related issues. This fix is one of them.This can be tested by defining and un-defining
TI_USE_KROLL_THREAD
in defines.h. Should work in both cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright. But if thats the case, we definitely need to make the Xcode builds behave the same as the actual
ti build -p ios
builds. Would it make sense to define it by default in the Xcode project? Should be the same with<use-autolayout/>
that triggers a different behavior.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I highly recommend that
TI_USE_KROLL_THREAD
is defined by default in our code base. This makes the Xcode build behave as expected. Actually it is quite easy to miss these thread related issues :(About this got to check with Kiat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. At least if we keep the main thread enabled by default. But as far as I know, I should get enabled by default starting in 6.0.0 in favor of Hyperloop. /cc @cheekiatng
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure we can make TI_USE_KROLL_THREAD default for now in our code base. However, there's a blocker for setting it to default starting in 6.0.0 due to https://jira.appcelerator.org/browse/TIMOB-19762.