Closed
Bug 389131
Opened 16 years ago
Closed 16 years ago
Reporter should move away from SOAP (Reporter fails to send reports on trunk)
Categories
(Other Applications Graveyard :: Reporter, defect)
Other Applications Graveyard
Reporter
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla1.9beta1
People
(Reporter: raccettura, Assigned: raccettura)
References
Details
(Whiteboard: [has patch][has reviews])
Attachments
(2 files, 4 obsolete files)
16.85 KB,
patch
|
Details | Diff | Splinter Review | |
948 bytes,
patch
|
raccettura
:
review+
neil
:
review+
|
Details | Diff | Splinter Review |
As a result of bug 332174, we should move the client/server away from soap. It was on soap since the code was based on another project I was working on at the time (and was soap based). Now is a good time to move away. My proposed change was to an xmlHttpRequest sending POST data. Same data. Any binary data (such as screenshots, which I still intend to add) would be base64 encoded and sent POST. Anyone see any caveats int his proposal?
Updated•16 years ago
|
Flags: blocking1.9?
Updated•16 years ago
|
Severity: normal → major
Summary: Reporter should move away from SOAP → Reporter should move away from SOAP (Reporter fails to send reports on trunk)
Version: unspecified → Trunk
Comment 2•16 years ago
|
||
Because of this change in Bug 332174 Reporter does not work on Trunk anymore. Reporter could be very helpful for Firefox 3 Beta 1 for Feedback of broken/problems with Websites (like as example Banking sites), so i think we should find a way to bring reporter back to working soon. I think this also something for the Release Notes for the next M8 Release, if reporter is then still broken.
Assignee | ||
Comment 3•16 years ago
|
||
Yea, I'm on... I've started work on it already.
Updated•16 years ago
|
Target Milestone: M9 → mozilla1.9beta
Comment 5•16 years ago
|
||
raccettura, progress so far?
Assignee | ||
Comment 6•16 years ago
|
||
I've got most of the server side done, and about half of this bug (the client side). If someone wants to pickup this one to speed things along... awesome, I'll post my current work and they can take it from there. I'm in a bad spot the next 1-2 weeks or so limiting my time, hence no patch thus far.
Assignee | ||
Comment 8•16 years ago
|
||
This is a working patch which converts the entire thing to using POST via xmlHttpRequest. It doesn't work against the current reporter production instance. The server is bug 389131 (also getting close). I'll try to get reporter-dev up and running with the updated service shortly for testing purposes. There's very likely some cleanup still needed in this patch. If someone wants to drive and either a) just clean it up, or b) review for clean up... cool.
Comment 9•16 years ago
|
||
Comment on attachment 282879 [details] [diff] [review] Patch v1 rough draft Some quick cleanup proposals: > var param = new Array(); >+ param['method'] = 'submitReport'; >+ param['rmoVers'] = gRMOvers; ... >+ param['sysid'] = sysId; var param = { method: 'submitReport', rmoVers: gRMOvers, ... sysid: sysId } >+ sendReporterServerData(serviceURL, param, 'onSendReportDataLoad'); sendReporterServerData(param, onSendReportDataLoad); >+function sendReporterServerData(serviceURL, params, callback) { function sendReporterServerData(params, callback) { var serviceURL = getCharPref("serviceURL", "http://reporter.mozilla.org/service/"); >+ params = serializeParams(params); >+ >+ var request = new XMLHttpRequest(); >+ request.onprogress = onSendReportDataProgress; >+ request.open("POST", serviceURL, true); >+ >+ request.onreadystatechange = function (aEvt) { >+ if (request.readyState == 4) { >+ eval(callback + '(request);'); >+ } >+ }; request.onreadystatechange = function () { if (request.readyState == 4) callback(request); };
Assignee | ||
Comment 11•16 years ago
|
||
Bare with me... lets get this going.
Attachment #282879 -
Attachment is obsolete: true
Attachment #286504 -
Flags: review?(dao)
Comment 12•16 years ago
|
||
Comment on attachment 286504 [details] [diff] [review] Patch v2 >Index: resources/content/reporter/reportWizard.js > var gPrefBranch; >+var gStatusIndicator lacks a semicolon >+ var param = { >+ 'method': 'submitRegister', >+ 'language': gParamLanguage >+ }; You don't need the apostrophes ahead of the colons; doesn't matter though. >+function onRegisterSysIDLoad(req){ >+ if (req.status == 200) { >+ gParamSysID = req.responseXML.getElementsByTagName('result').item(0).firstChild.data; >+ >+ // saving >+ if (gParamSysID != undefined){ >+ var prefs = getReporterPrefBranch(); >+ prefs.setCharPref("sysid", gParamSysID); gParamSysID doesn't need to be global, does it? The |undefined| check looks wrong to me, |.firstChild| will throw if there's no 'result' element. How about: > var paramSysID = req.responseXML.getElementsByTagName('result').item(0); > > // saving > if (paramSysID) { > var prefs = getReporterPrefBranch(); > prefs.setCharPref("sysid", paramSysID.textContent); >+ // Invalid Response Error >+ showError('An Invalid response was recieved from the server. Please try again later.'); >+ return; something to localize? >+ // On error >+ var errorStr = extractError(req); >+ showError(errorStr); >+ return; > } >+ request.send(params); >+ return; >+} superfluous |return| in both cases >+function serializeParams(params) { >+ var str = ''; >+ for (var key in params) { >+ str += key + '=' + escape(params[key]) + '&'; I don't think |escape| is right here, use encodeURIComponent for UTF-8. >+function onSendReportDataLoad(req) { >+ var error = false; >+ >+ var reportWizard = document.getElementById('reportWizard'); > var finishSummary = document.getElementById('finishSummary'); > var finishExtendedFailed = document.getElementById('finishExtendedFailed'); > var finishExtendedSuccess = document.getElementById('finishExtendedSuccess'); >+ var statusDescription = document.getElementById('sendReportProgressDescription'); > >+ if (req.status != 200) { >+ var errorStr = extractError(req); >+ showError(errorStr); >+ return; You're not using the |error| variable, and the other declarations should probably go beneath the |if|. >+function extractError(req){ >+ var strbundle = document.getElementById("strings"); >+ // Check the response >+ if(req.responseXML.getElementsByTagName('errorString').item(0)){ >+ return req.responseXML.getElementsByTagName('errorString').item(0).firstChild.data; >+ } --> > var error = req.responseXML.getElementsByTagName('errorString').item(0) > if (error) > return error.textContent; and the indention isn't quite right. >+function showError(errorStr){ >+ // If there was an error from the server >+ finishExtendedSuccess.setAttribute("class", "hide"); finishExtendedSuccess.className = "hide";
Attachment #286504 -
Flags: review?(dao) → review-
Assignee | ||
Comment 13•16 years ago
|
||
Addresses comments, also is a complete diff against all changed files (I missed a little big before).
Attachment #286504 -
Attachment is obsolete: true
Attachment #286628 -
Flags: review?
Assignee | ||
Updated•16 years ago
|
Attachment #286628 -
Flags: review? → review?(dao)
Comment 14•16 years ago
|
||
Comment on attachment 286628 [details] [diff] [review] Patch v3 Looks good to me. > // Globals >+var gParamSysID; This declaration should go away. >+ // If successful >+ finishExtendedFailed.setAttribute("class", "hide"); You can also use className here. (Better yet: Set .hidden = true and remove the class from the stylesheet.) Same for .setAttribute("value",...) vs .value = ...
Attachment #286628 -
Flags: review?(dao) → review+
Comment 15•16 years ago
|
||
Robert, if you can get one last rev with Dao's comments I can review today.
Flags: blocking1.9? → blocking1.9+
Assignee | ||
Comment 16•16 years ago
|
||
I can't hit this until tonight as I'm behind a firewall that isn't cvs friendly. It is my intention to get this tonight. Then if you want, you can review and checkin on my behalf. It doesn't have to wait for 389128 since it's busted both ways. I'll also update reporter-dev with the patch from 389128 so you can test against that.
Comment 17•16 years ago
|
||
Once you have final review from mconnor, you can just add the "checkin-needed" keyword, and somebody (probably me) will commit the final reviewed patch for you.
Assignee | ||
Comment 18•16 years ago
|
||
As promised
Attachment #286628 -
Attachment is obsolete: true
Attachment #286777 -
Flags: review?(mconnor)
Comment 19•16 years ago
|
||
Comment on attachment 286777 [details] [diff] [review] Patch v4 >+++ locales/en-US/chrome/reportWizard.properties 30 Oct 2007 01:17:59 -0000 >@@ -8,3 +8,6 @@ > > successfullyCreatedReport=Successfully Transmitted Report > failedCreatingReport=There was an error creating the report, and so no information was sent to mozilla.org >+defaultError=Unable to make a successful connection to the server. >+invalidResponse=An Invalid response was recieved from the server. Please try again later. An invalid response was received from the server. Please try again later. > function sendReport() { >+ random whitespace. whoever lands this, please fix on checkin >+function sendReporterServerData(params, callback) { >+ var serviceURL = getCharPref("serviceURL", "http://reporter.mozilla.org/service/"); this should be /service/0.3/ right? >+function serializeParams(params) { >+ var str = ''; >+ for (var key in params) { >+ str += key + '=' + encodeURIComponent(params[key]) + '&'; >+ } >+ return str.substr(0, str.length-1); >+} I hate doing stuff like that, there's never a really clean solution. :) >+function onSendReportDataLoad(req) { >+ >+ if (req.status != 200) { >+ more weird whitespace :) please make those changes and attach a new patch, and hang a checkin-needed keyword if you can't land yourself. thanks again!
Attachment #286777 -
Flags: review?(mconnor) → review+
Updated•16 years ago
|
Whiteboard: [has patch][need final patch for landing]
Assignee | ||
Comment 20•16 years ago
|
||
This should do it. As a last note, this will obviously have no real effect until bug 389128 is checked in (to happen now), and pushed live (in a bug to be filed). I don't have the time to be on the hook ATM and likely won't until Friday evening. If someone wants to be a pal and checkin, feel free (noting above caveat). Otherwise I'll take care of it then.
Attachment #286777 -
Attachment is obsolete: true
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][need final patch for landing] → [has patch][checkin-needed]
Updated•16 years ago
|
Keywords: checkin-needed
Whiteboard: [has patch][checkin-needed] → [has patch]
Comment 21•16 years ago
|
||
Checking in extensions/reporter/locales/en-US/chrome/reportWizard.properties; /cvsroot/mozilla/extensions/reporter/locales/en-US/chrome/reportWizard.properties,v <-- reportWizard.properties new revision: 1.7; previous revision: 1.6 done Checking in extensions/reporter/resources/content/prefs/reporter.js; /cvsroot/mozilla/extensions/reporter/resources/content/prefs/reporter.js,v <-- reporter.js new revision: 1.4; previous revision: 1.3 done Checking in extensions/reporter/resources/content/reporter/reportWizard.js; /cvsroot/mozilla/extensions/reporter/resources/content/reporter/reportWizard.js,v <-- reportWizard.js new revision: 1.29; previous revision: 1.28 done Checking in extensions/reporter/resources/skin/classic/reporter/reportWizard.css; /cvsroot/mozilla/extensions/reporter/resources/skin/classic/reporter/reportWizard.css,v <-- reportWizard.css new revision: 1.5; previous revision: 1.4 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [has patch] → [has patch][has reviews]
Assignee | ||
Comment 22•16 years ago
|
||
Reed, you're awesome. Thanks everyone for the last minute push. For the curious bug 401816 is for deploying the server side.
Comment 23•16 years ago
|
||
Comment on attachment 286777 [details] [diff] [review] Patch v4 >+ return str.substr(0, str.length-1); return str.slice(0, -1);
Comment 24•16 years ago
|
||
Attachment #286942 -
Flags: review?(robert)
Attachment #286942 -
Flags: review?(neil)
Updated•16 years ago
|
Attachment #286942 -
Flags: review?(neil) → review+
Assignee | ||
Comment 26•16 years ago
|
||
Comment on attachment 286942 [details] [diff] [review] address neil's nit simple enough. r=me
Attachment #286942 -
Flags: review?(robert) → review+
Comment 27•16 years ago
|
||
Checked-in nit fix. Checking in extensions/reporter/resources/content/reporter/reportWizard.js; /cvsroot/mozilla/extensions/reporter/resources/content/reporter/reportWizard.js,v <-- reportWizard.js new revision: 1.30; previous revision: 1.29 done
Updated•5 years ago
|
Product: Other Applications → Other Applications Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•