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): allow TiDownloadManager to fire fail listener #11575

Merged
merged 4 commits into from Apr 28, 2020

Conversation

garymathews
Copy link
Contributor

  • Allow TiDownloadManager to fire fail listener, which prevented error events for some components
TEST CASE
const win = Ti.UI.createWindow();
const img = Ti.UI.createImageView({
	image: 'https://invalid.host.com/image.jpg'
});

img.addEventListener('error', e => {
	console.error(JSON.stringify(e, null, 4));
});

win.add(img);
win.open();

JIRA Ticket

@garymathews garymathews added this to the 9.1.0 milestone Mar 26, 2020
@build build requested a review from a team March 27, 2020 00:00
@build
Copy link
Contributor

build commented Mar 27, 2020

Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 6660 tests are passing.
(There are 698 skipped tests not included in that total)

Generated by 🚫 dangerJS against 3c8e3de

@sgtcoolguy
Copy link
Contributor

@garymathews Can you please turn that manual test into a mocha test? It looks like it should be pretty straightforward to convert...

@garymathews
Copy link
Contributor Author

@jquick-axway Updated PR

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: Pass

@jquick-axway
Copy link
Contributor

@garymathews, using AtomicReference to box the exception was a smart idea. I like it. And you're the first person to add a Java lambda to our codebase. 👍

Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR passed: Able to see the correct events being fired, tested with the test case above and the following test case:

Ti.UI.setBackgroundColor('#000');

var tabGroup = Ti.UI.createTabGroup();

var win1 = Ti.UI.createWindow({
    title:'Tab 1',
    backgroundColor:'#fff',
});

var img = Ti.UI.createImageView({
	image:'http://files.daddyhunt.com/sites/default/files/imagecache/mangrid-212/photos/z/z/z/277606/Photo_on_2010-09-14_at_13.14_3.jpg'
});
win1.add(img);
img.addEventListener('error', function(){
    Ti.API.info('--------------fired error event----------');
});

tabGroup.addTab(Ti.UI.createTab({
    title:'Tab 1',
    window:win1
}));
tabGroup.open();

Test Environment

MacOS Catalina: 10.15.5 Beta
Xcode: 11.4
Java Version: 1.8.0_131
Android NDK: 21.1.6273396-beta2
Node.js: 10.16.3
""NPM":"5.0.0-1","CLI":"8.0.0-master.10""
Pixel Xl 7.1.1 Sim

@sgtcoolguy sgtcoolguy merged commit 68d11f7 into tidev:master Apr 28, 2020
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