Closed Bug 365899 Opened 18 years ago Closed 3 years ago

"nsIXmlRpcClient.inProgress" returns false even if a RPC is in progress

Categories

(Core :: XML, defect)

1.8 Branch
x86
All
defect
Not set
major

Tracking

()

RESOLVED WONTFIX

People

(Reporter: maisel, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1

"nsIXmlRpcClient.inProgress" in '@mozilla.org/xml-rpc/client;1' should report wether or not a call is in progress, but it always returns false, even if a RPC is in progress. The method used to work in FF 1.5.0.*.

Programming Language is JavaScript.

Reproducible: Always

Steps to Reproduce:
1. create instance of '@mozilla.org/xml-rpc/client;1'
2. call object's method "inProgress"
3. do a RPC
4. again call object's method "inProgress" while the RPC obviously is in progress
Actual Results:  
In both steps 2 and 4 the method returns 'false' although it should be 'true' in step 4. If the developer relies on that information and does the next RPC nsIXmlRpcClient throws an exception which states that there actually is a RPC in progress:

[Exception... "Call in progress!"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///home/foo/firefox-2.0.0.1/components/nsXmlRpcClient.js :: anonymous :: line 137"  data: no]
Quelldatei: file:///home/foo/firefox-2.0.0.1/components/nsXmlRpcClient.js
Zeile: 137

Expected Results:  
It should report the correct state.
Over to Core::General for triage.
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → 1.8 Branch
Severity: normal → major
OS: Linux → All
I think I see this too.  I used my rudimentary Javascript skills to hack together this test, which I feel proves the bug is there:

var finished = false; var Listener = { onResult : function(client, ctxt, result) { finished = true; }, onFault : Listener.onResult, onError : Listener.onResult }; var xmlRpc = Components.classes["@mozilla.org/xml-rpc/client;1"].createInstance(Components.interfaces.nsIXmlRpcClient); xmlRpc.init('http://betty.userland.com/RPC2'); var stateCode = xmlRpc.createType(xmlRpc.INT, {}); stateCode.data = 25; xmlRpc.asyncCall(Listener, null, 'examples.getStateName', [stateCode], 1); while(xmlRpc.inProgress) {}; if(!finished) { alert('inProgress is buggy'); } else { alert('inProgress is OK'); }

Running this in the JS Error Console evaluation box, I get an alert saying inProgress is buggy.  This test works by looping on inProgress (the loop will exit immediately if the bug is true, that inProgress is always false), and then checking to see if the call really did finish according to a listener function being called (regardless of success/fail).  This may not be a correct test...

Does anyone have a workaround?  I'm writing some code where I want to do concurrent RPCs, so I keep a stack of created XmlRpcClient obs and recycle them when possible, to try to conserve memory and such.  It's really important to me to be able to truly judge whether a call is in progress.  I guess I may have to somehow track it myself, because I don't see any other exposed properties/functions of use.
this bug seems to be still there in rv:1.8.1.5
Component: General → XML
QA Contact: general → xml

The XML-RPC component was removed (I think before Firefox 3).

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
QA Whiteboard: qa-not-actionable
You need to log in before you can comment on or make changes to this bug.