Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): incremental build creates duplicate "bootstrap.json" entries #11727

Merged
merged 2 commits into from Jun 3, 2020

Conversation

jquick-axway
Copy link
Contributor

JIRA:
https://jira.appcelerator.org/browse/TIMOB-27904

Summary:
This is a regression as of Titanium 8.1.0. Every incremental build duplicates a bootstrap entry in the "bootstrap.json" file, causing its execute() function to be wrongly invoked multiple times on app startup.

Test:

  1. Create a Titanium app project.
  2. Copy below test.bootstrap.js to Resources directory. Do not change the file name.
  3. Build and run on Android.
  4. Notice a bootstrap dialog appears once. (This is good.)
  5. Build and run on Android again.
  6. Verify that bootstrap dialog only appears once.

test.bootstrap.js

Ti.API.info("### Bootstrap was required-in.");

var wasExecuted = false;
exports.execute = function(finished) {
	Ti.API.info("### Bootstrap execute() method was called.");
	var message = "This is the bootstrap dialog.";
	if (wasExecuted) {
		message = "Uh-oh!!! Bootstrap was wrongly executed again.";
	}
	var dialog = Ti.UI.createAlertDialog({
		message: message,
		buttonNames: ['OK'],
		cancel: 0,
		persistent: true,
	});
	dialog.addEventListener('click', finished);
	dialog.addEventListener('cancel', finished);
	dialog.show();
	wasExecuted = true;
};

- Bootstrap file fetching code was moved to core "process-js-task.js" file in 8.1.0.
@build
Copy link
Contributor

build commented May 21, 2020

Fails
🚫 Tests have failed, see below for more information.
Messages
📖 👍 Hey!, You deleted more code than you added. That's awesome!
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 8 tests have failed There are 8 tests failing and 703 skipped out of 7229 total tests.

Tests:

ClassnameNameTimeError
android.emulator.Titanium.UI.Window.eventsclose event is fired (9)20.017
Error: timeout of 20000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)
android.emulator.Titanium.UI.Window.activity transitionsTRANSITION_NONE (9)10.013
Error: timeout of 10000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)
android.emulator.Titanium.UI.Window.activity transitionsTRANSITION_EXPLODE (9)10.007
Error: timeout of 10000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)
android.emulator.Titanium.UI.Window.activity transitionsTRANSITION_SLIDE_BOTTOM (9)10.008
Error: timeout of 10000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)
android.emulator.Titanium.UI.Window.activity transitionsTRANSITION_SLIDE_TOP (9)10.008
Error: timeout of 10000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)
android.emulator.Titanium.UI.Window.activity transitionsTRANSITION_SLIDE_LEFT (9)10.02
Error: timeout of 10000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)
android.emulator.Titanium.UI.Window.activity transitionsTRANSITION_SLIDE_RIGHT (9)10.015
Error: timeout of 10000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)
android.emulator.Titanium.UI.Window.activity transitionsTRANSITION_FADE_IN/TRANSITION_FADE_OUT (9)10.048
Error: timeout of 10000ms exceeded
at Titanium.<anonymous> (/ti-mocha.js:6535:53723)

Generated by 🚫 dangerJS against e0b3468

@ssekhri
Copy link

ssekhri commented May 26, 2020

FR Passed.

Verified on:
Mac OS: 10.15.4
SDK: 9.1.0.v20200521135203
Appc CLI: 8.0.0
JDK: 11.0.6
Node: 10.17.0
Studio: 6.0.0.202005141803
Device: Nexus4(v5.1.1) device, Pixel3(v10.0) emulator

@sgtcoolguy sgtcoolguy merged commit 571b2e6 into tidev:master Jun 3, 2020
sgtcoolguy pushed a commit that referenced this pull request Jun 3, 2020
…11727)

- Bootstrap file fetching code was moved to core "process-js-task.js" file in 8.1.0.

Fixes TIMOB-27904
@sgtcoolguy
Copy link
Contributor

cherry-picked to 9_0_X as well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants