Skip to content

Ensure permissions log only stores JSON-able data#10524

Merged
rekmarks merged 1 commit intodevelopfrom
fix-permission-log-storage-safety
Mar 10, 2021
Merged

Ensure permissions log only stores JSON-able data#10524
rekmarks merged 1 commit intodevelopfrom
fix-permission-log-storage-safety

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Feb 25, 2021

This PR ensures that the permissions log will only store JSON-able data. I encountered this problem will building for snaps. This is unlikely, probably even impossible, to occur on develop at the moment, but the fix is cheap. It's accomplished as follows:

  • Replace deep clone of JSON-RPC request and response objects in permissions log with stringification via fast-safe-stringify
  • Add fast-safe-stringify as production dependency
    • It was already in our dependency graph, used by eth-rpc-errors and probably others

Additionally, makes the following related but distinct change:

  • Remove safe-json-stringify from production dependencies
    • This dependency was unused. In the choice between it and fast-safe-stringify, the latter appears to be more widely used, and will remain our dependency graph regardless. Removing safe-json-stringify as a direct dependency removed it from our lockfile.

@rekmarks rekmarks requested a review from a team as a code owner February 25, 2021 22:17
@rekmarks rekmarks requested a review from shanejonas February 25, 2021 22:17
@metamaskbot
Copy link
Collaborator

Builds ready [bdc6d42]
Page Load Metrics (601 ± 21 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint47705873
domContentLoaded5447445994321
load5457466014321
domInteractive5437445984321

@rekmarks rekmarks merged commit a29fc51 into develop Mar 10, 2021
@rekmarks rekmarks deleted the fix-permission-log-storage-safety branch March 10, 2021 19:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants