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

[6_1_X][TIMOB-24809] Android: HTTPClient - "onload" not dispatched. #9140

Merged
merged 7 commits into from Jun 14, 2017

Conversation

ypbnv
Copy link
Contributor

@ypbnv ypbnv commented Jun 12, 2017

Backport of: #9139

Clear parts and pairs collections before reusing the client.
@ypbnv ypbnv added this to the 6.1.1 milestone Jun 12, 2017
@ypbnv ypbnv requested a review from garymathews June 12, 2017 09:12
@garymathews garymathews changed the title [TIMOB-24809] Android: HTTPClient - "onload" not dispatched. [6_1_X][TIMOB-24809] Android: HTTPClient - "onload" not dispatched. Jun 12, 2017
Copy link
Contributor

@garymathews garymathews 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
FT: PASS

@ssjsamir ssjsamir self-requested a review June 12, 2017 17:00
@ypbnv
Copy link
Contributor Author

ypbnv commented Jun 13, 2017

@garymathews Would you take a look at the guarding change?

@ssjsamir
Copy link
Contributor

ssjsamir commented Jun 13, 2017

Master: #9139
FR Passed: Error is no longer shown when a request is finished.

Test Steps:

  • Downloaded the SDK Build form this PR
  • Created a new Titanium project
  • Copied the the test case from description
  • Ran the application
  • Pressed Get Photos
  • Saw the Response
  • Pressed the upload button
  • Error was not shown

Test Environment
Appcelerator Command-Line Interface, version 6.2.2
Google Nexus 6P (7.1.1)
Operating System Name: Mac OS X El Capitan
Operating System Version: 10.11.6
Node.js Version: 6.10.1
Xcode: 8.2
Appcelerator Studio: 4.9.0.201705251638

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

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

CR: FAIL

Copy link
Contributor

@garymathews garymathews 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

👍

@ssjsamir
Copy link
Contributor

FR Passed following the earlier steps. However I did change the requestbin link as the link had expired.

var window = Ti.UI.createWindow();
var buttonUpload = Ti.UI.createButton({title:"Upload", top:50});
var buttonGetPhotos = Ti.UI.createButton({title:"Get Photos", top: 110});
var xhr = Titanium.Network.createHTTPClient({timeout:5000});
 
var tempF = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,"simpleTest.png");
Ti.API.info(tempF);
 
buttonUpload.addEventListener('click', function (e) {
    xhr.open("POST","https://requestb.in/16ixvgy1");
 
    var data_to_send = {
        "file": tempF.read(),
    };
 
    xhr.onload = function () {(alert(this.responseText))};
    xhr.send(data_to_send);
});
 
buttonGetPhotos.addEventListener('click', function (e) {    
    xhr.open("POST","https://requestb.in/16ixvgy1");
 
    var params = {
            id:46
    };
 
    xhr.onload = function (e) {alert(this.responseText)};
    xhr.send(params);
});
 
window.add(buttonGetPhotos);
window.add(buttonUpload);
window.open();

Test Steps:

  • Downloaded the SDK Build form this PR
  • Created a new Titanium project
  • Copied the the test case from description
  • Ran the application
  • Pressed Get Photos
  • Saw the Response
  • Pressed the upload button
  • Error was not shown

Test Environment
Appcelerator Command-Line Interface, version 6.2.2
Google Nexus 6P (7.1.1)
Operating System Name: Mac OS X El Capitan
Operating System Version: 10.11.6
Node.js Version: 6.10.1
Xcode: 8.2
Appcelerator Studio: 4.9.0.201705251638

@ssjsamir ssjsamir merged commit bc8547d into tidev:6_1_X Jun 14, 2017
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

3 participants