-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restrict the size of the permissions metadata store #8596
Conversation
/** | ||
* Removes all known domains and their related permissions. | ||
*/ | ||
clearPermissions () { | ||
this.permissions.clearDomains() | ||
this.notifyAllDomains({ | ||
method: NOTIFICATION_NAMES.accountsChanged, | ||
result: [], | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function was moved, because its placement didn't make any sense. It hasn't been changed.
This is the only formatting change in this PR.
Do we ever want to trim metadata for sites with permissions? 🤔 I don't see the harm in keeping that. We use it in the UI anyway - we'd have to remove the permission too to avoid weird UI bugs. |
Builds ready [e2e75ea]
Page Load Metrics (626 ± 74 ms)
|
Builds ready [8b4df94]
Page Load Metrics (584 ± 68 ms)
|
d655755
to
a8a3865
Compare
047feba
to
bec3dab
Compare
Builds ready [bec3dab]
Page Load Metrics (644 ± 31 ms)
|
Builds ready [bb8e211]
Page Load Metrics (600 ± 51 ms)
|
Builds ready [e96a18e]
Page Load Metrics (666 ± 34 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If there are 100 or more domains in the metadata store, we attempt to remove a domain without permissions before adding a new one
- This only fails if there is no domain metadata for a domain without permissions
What is supposed to happen in this failure case?
@whymarrh all inline comments addressed in d3c7d89. Regarding your question:
The PR description was outdated; there is no failure case. The bullet point you referred to has been updated to read:
|
Builds ready [c3b7128]
Page Load Metrics (885 ± 72 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
test/unit/app/controllers/permissions/permissions-controller-test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds ready [87d1bf3]
Page Load Metrics (676 ± 52 ms)
|
Closes #8569
This PR bounds the size of the permissions metadata store to the number of domains with permissions.
8.x
_pendingSiteMetadata
set8.x