Unexpected Promise failure

  • Goal: Initialize a variable within app, to be used when it triggers a query

  • Steps: Trying to use Promise.all( ).then() structure to control the timing

  • Details & Screenshots:

The Promise fails, even though the variable actually gets set.

Code:
image

Logs:
image

Variable actually gets set correctly:
image

Anybody see what I've got wrong?

I ended up totally rewriting this, and got something that achieved my end goal. However, I think the problem is appending a .then() onto the Promise.all().

I think your problem is that Promise.all should be called on an array of promises. I would say that idList.setValue({}) is not going to return an array of promises. One option would be

idList.setValue({}).then(
(x) => {console.log("success")
...