Open janjongboom opened 8 years ago
I think the trouble is that e.result gets filled with this, and then I exited too early. We should not store that value in result.
That is done very much on purpose. You did not wait for e.isDone() nor did you check for e.error.
I don't agree on this behavior now. We change the value of e.result
, which should be immutable. There either is a response or there isn't. What if I have some other work to do, and thus get back to this value 2s later, the result can be different than before.
We should use a different property than result for the asyncResponseId.
If you try to read the result before e.isDone() is true then there is no guarantee what will be in e.result. I enabled this for debugging purposes. Likely use case being a user keeps requesting something, it never finishes (never isDOne == True), so to debug it is helpful to know what the async-response-id for that call was. Otherwise there is no good way to figure this out.
When the call completes then result is overwritten with the result.
Current getResourceValue response holds in
e.result
: