Replace message table data with message payload in console messages Redux store
Categories
(DevTools :: Console, task, P2)
Tracking
(firefox69 fixed)
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: rcaliman, Assigned: rcaliman)
References
Details
Attachments
(1 file)
Follow-up from code review for Bug 1093953.
The patch for bug 1093953 introduced a generic messagesPayloadById
entry in the Console's messages
Redux state. It's meant to hold additional data associated with a message. It is populated on-demand at a later time after the message is first received instead of mutating the original message.
The reducer signature is identical to the messagesTableDataById
entry in the store. This looks like a specialized case for holding table data for a Console API call message, but it can be generalized to use messagesPayloadById
instead.
In a gist:
- the
messageTableDataGet()
action can persist the result by callingmessageUpdatePayload()
instead ofmessageTableDataReceive()
since the signatures are the same. tableData
can be removed as a prop in favor of thepayload
prop (introduced with Bug 1093953) that gets passed down the component chain all the way toConsoleApiCall
. Here,payload
can be used just astableData
– it's an arbitrary store of data.
It is feasible. It can clean up the code slightly. If this is desirable please prioritize this bug and I'll work on it. If not, no hard feelings. Things work as-is anyway.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Follow-up to Bug 1093953 which introduced a generalized payload
object for messages to be populated asynchronously with additional data associated with the message after it is initially received.
The reasoning is: messages can have arbitrary data payload associated with them. The rendering component for the message type will consume and validate that payload data.
Here, we replace the specialized messageTableDataByID with the generalized messagePayloadByID, update corresponding Redux actions, reducers, selectors and tests.
The only place where tableData
is used is in the ConsoleApiCall
message type, in the ConsoleTable
component. We replace it with payload
which is sent down to all message types anyway.
Assignee | ||
Comment 3•5 years ago
|
||
Pushed by rcaliman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5ad0d430d2cc Replace message table data with generalized message payload. r=nchevobbe
Comment 5•5 years ago
|
||
bugherder |
Comment 6•5 years ago
|
||
bugherder |
Description
•