Repository navigation
Conversation
commit: |
Merging this PR will degrade performance by 5.04%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | effection-inline.recursion |
4.7 KB | 5.8 KB | -19.35% |
| ⚡ | Memory | effection.events |
98.5 KB | 88.1 KB | +11.82% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing jrandolf:jrandolf/error-unknown (a00070f) with v4 (70ddc1c)
|
Hey @jrandolf, Thanks for the PR! This is definitely a breaking change. I'm not opposed to it, but I'm curious why you think it is lossy? All information is retained, and If you are capturing a result object in the first place then by definition you are already preventing code upwards on the stack from seeing the throw value. In order to re-expose the stack to the error, you are would already need to destructure via the Or is the problem that Effection itself does not do this when it re-throws an error? That would definitely be a problem |
|
Yes. Effection itself rethrows the wrapper. #1149 established Changing This PR changes the common representation instead. SvelteKit shows why that matters. Its |
|
Right. This could be a change that could be accepted as part of a 5.0 release, but since it breaks a public API, it cannot go into the v4 release series as-is. However, failure to unbox is a bug in v4 and should be fixed. |
|
I think the path forward here is to start a v5 branch with this as the first change on it, and then add the unwrapping behavior to v4. Is that latter item something you'd be willing to take on? |
|
Let's do it! |
|
@cowboyd I opened #1230 with the v4-compatible fix: explicit |
|
@cowboyd Will you create the v5 branch? I don't have permission for this. |
|
@jrandolf done! |
a00070f to
f4ceb1b
Compare
|
@cowboyd This PR is ready! |
Motivation
Effection v4 preserves thrown values during automatic propagation (#1230), but explicit
Err()andallSettled()results still wrap non-Errorvalues. This v5 change preserves their identity in explicit results too, as agreed in the discussion.Approach
Make
Result.errorand rejection parametersunknown, store causes unchanged, and removeThrownValueError. Retain the v4 propagation tests and add coverage for explicit results and repeated resolver consumption.