-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Feat: show site if no connection but has gator permissions #36811
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
base: feat/revoke-all-permissions-on-site-disconnect
Are you sure you want to change the base?
Feat: show site if no connection but has gator permissions #36811
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
if (permission.permissionResponse.address) { | ||
permissionData.addresses.add( | ||
permission.permissionResponse.address.toLowerCase(), | ||
); |
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.
Bug: Undefined Object Access and Type Errors
The getUniqueSiteOriginsFromGatorPermissions
function accesses permission.permissionResponse.chainId
and permission.permissionResponse.address
without ensuring permissionResponse
is defined, which can cause TypeError
s. It also calls .toLowerCase()
on the address without confirming it's a string, potentially leading to further runtime errors.
}); | ||
|
||
return mergedConnections; | ||
}); |
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.
Bug: Selector Callback Captures External Dependencies
The mergedConnectionsList
selector's callback captures sitesConnectionsList
and gatorPermissionsMap
from its closure. This prevents useSelector
from tracking these external dependencies, resulting in stale data when they change. Additionally, the getUniqueSiteOriginsFromGatorPermissions
helper function is defined within the component, causing it to be recreated on each render and impacting selector memoization.
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (1 files, +86 -4)
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [51ea5f2]
UI Startup Metrics (1274 ± 85 ms)
|
Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Permissions page now merges sites derived from gator permissions into the list (with metadata and network info) when the revocation feature is enabled, even if no site connection exists.
ui/components/multichain/pages/permissions-page/permissions-page.js
):siteOrigin
entries from gator permissions, collecting addresses and firstchainId
.networkName
viagetNetworkNameByChainId
and setssubjectType
toSubjectType.Website
.name
/iconUrl
viagetTargetSubjectMetadata
, falling back to hostname viagetURLHostName
.getTargetSubjectMetadata
,getGatorPermissionsMap
, and related utils; switches calculations fromsitesConnectionsList
tomergedConnectionsList
.Written by Cursor Bugbot for commit 51ea5f2. This will update automatically on new commits. Configure here.