Closed Bug 1548833 Opened 5 years ago Closed 5 years ago

Replace message table data with message payload in console messages Redux store

Categories

(DevTools :: Console, task, P2)

task

Tracking

(firefox69 fixed)

RESOLVED FIXED
Firefox 69
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 calling messageUpdatePayload() instead of messageTableDataReceive() since the signatures are the same.
  • tableData can be removed as a prop in favor of the payload prop (introduced with Bug 1093953) that gets passed down the component chain all the way to ConsoleApiCall. Here, payload can be used just as tableData – 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.

No longer blocks: 1093953
Depends on: 1093953

I like the idea, let's do it when we have some time :)

Priority: -- → P2
Assignee: nobody → rcaliman
Status: NEW → ASSIGNED
Summary: Consider replacing message table data with message payload in console messages Redux store → Replace message table data with message payload in console messages Redux store

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.

Pushed by rcaliman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5ad0d430d2cc
Replace message table data with generalized message payload. r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
Regressions: 1557954
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: