Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Ensuring publishers file is read from as little possible #14743

Merged
merged 1 commit into from
Jul 15, 2018

Conversation

ryanml
Copy link
Contributor

@ryanml ryanml commented Jul 14, 2018

We have publisherInfoData as an in-memory storage of the publisher verification data. When the publishers file is written to, this variable receives a copy of the information. We should look to this variable first for the data rather than reading from the file. In the case that we restart the browser, we should read the file but once then copy that info in to memory.

This gives a max file read per session of 1.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ so that we can get a new build

@bsclifton bsclifton merged commit d603250 into brave:master Jul 15, 2018
bsclifton added a commit that referenced this pull request Jul 15, 2018
Ensuring publishers file is read from as little possible
bsclifton added a commit that referenced this pull request Jul 15, 2018
Ensuring publishers file is read from as little possible
@bsclifton
Copy link
Member

master d603250
0.24.x d7b2aec
0.23.x 7c7d573

@@ -703,8 +703,9 @@ const runPublishersUpdate = (state) => {
const updatePublishers = (state, publisherKeys) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I'm late to the party, but for future ref:
Is state getting updated at all in updatePublishers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot. It doesn't hurt anything at the moment but we can change this in a future PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants