Open Bug 1582696 Opened 5 years ago Updated 2 years ago

Remove task.js shared middleware in create-store

Categories

(DevTools :: Shared Components, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

References

Details

devtools/client/shared/redux/middleware/task.js is called from devtools/client/shared/redux/create-store.js which is used in a few panel (inspector, memory, accessibility) and the toolbox.

I find it confusing as it works almost the same as the thunk middleware, except it only acts on async function (and generators, but I don't think we have generator actions) and call the action and attach a catch callback to it that dispatch an "error" action that the reducer can then handle.
In facts, only the memory panel make use of this capability (i.e. retrieving errors).
But what it does is that it "hide" all exceptions that may be thrown by an action.
For example, removing the midleware will make a lot of tests fail because of pending promises while closing the connection (which we shouldn't do).

It also takes precedence over the thunk middleware, which makes it harder if you want the action to be dispatched to have a different signature.

Depends on: 1582697
Blocks: 1582699
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.