08:25
<Stephen Belanger>

So if context always flows into all branches, all we actually need is the context as it was when it reached a merge barrier. For example, context flows into each of the promise-returning functions passed into a Promise.all(...). Each of these branches can change their context along the path but will only ever have one value. When the value eventually reaches the merge barrier where it would get placed in the array the Promise.all(...) call resolves to it would capture the single context value in that branch and store it in a merge context array of equal length to the Promise.all(...) input and output size.

The resulting merge context makes the most sense though if the resolve path is followed rather than the register path. If the register path is followed it just flattens same as the async/await issue I brought up, which means none of that merge context would reach anywhere useful if the register on the Promise.all(...) discards all that inner behaviour by binding around it. This is the sort of scenario why I want to have a way to get at calling context whenever a snapshot is restored. Either that or have a way to, on a per-store basis, reject the snapshot restore decision and keep using the value that propagated through the internal branch.

Merge contexts are a bit weird though as it transforms a single value into an array of values, so I think it still makes sense to "pick a winner" for the default behaviour and just provide power users an additional power tool there, which might require a bit more manual intervention, to get at the full merge context list.

11:29
<Andreu Botella>

While thinking about the rejection context of web APIs that take async callbacks, I realized that if you do something like this, there's no way to preserve the original rejection context even if you explicitly want to:

asyncCb().catch(err => {
    if (something(err)) {
        return someValue;
    } else {
        throw err;
    }
});
11:30
<Andreu Botella>
at least that would be in the current spec text
11:30
<Andreu Botella>
in Stephen's version it would work as expected
11:31
<Andreu Botella>
fulfillment contexts aren't observable, but rejection contexts are with unhandledrejection
17:08
<Chengzhong Wu>
ICYMI notes are here https://docs.google.com/document/d/1pi-NMbqVhg2UuxQAZ4jOGDeHLlZGD_DJ7fyxHt_C2hs/edit and please feel free to correct it
22:11
<littledan>
#83 has made me pretty concerned about scope creep. But I'm also obviously concerned about my own pet use cases. I've got a meeting with Jatin this evening to hopefully nail down exactly what kind of registration- vs. call-time semantics we will need.
I am curious what you found in that discussion
23:42
<littledan>
Does anyone have a consolidated description of what “Stephen’s version” is?
23:43
<littledan>
I mean in particular what the diff would be vs the current proposal (without the other superficial changes)
23:49
<littledan>
Per-instance wrap is a convenience function, in my understanding. Did you get a chance to discuss that? I don’t see notes about it
23:50
<littledan>
Did we ever get an answer on how callingContext would relate to Promise.all?