Skip to content
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

Handle one specific permissions request per tab #7620

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Dec 3, 2019

The connect route now takes a route parameter: the permissions request id. This id is set whenever the permissions connect screen is opened, ensuring that that tab is for that specific request alone.

This makes handling of multiple permissions requests a bit more intuitive. Previously whenever opening multiple permissions requests, the first one would be shown on each successive tab, whereas you would expect each tab to show the request that prompted the tab to open. Users may now address permissions request in whichever order they'd like to, rather than being forced to deal with them chronologically.

@metamaskbot
Copy link
Collaborator

Builds ready [97b5093]

const permissionsRequests = getPermissionsRequests(state)

const permissionsRequest = permissionsRequests
.find(permissionsRequest => permissionsRequest.metadata.id === permissionsRequestId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we can assume that permissionsRequest.metadata will always be an object

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can. This is the only place requests are added: https://github.com/MetaMask/rpc-cap/blob/master/index.ts#L817

Copy link
Member

@rekmarks rekmarks Dec 4, 2019

Choose a reason for hiding this comment

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

Yeah, that rpc-cap metadata has not been a problem historically. Site/domain metadata in the permissions middleware has caused trouble by not existing (ごめんなさい 🙇).

Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

Reviewed and left one comment. Looks good otherwise.

The connect route now takes a route parameter: the permissions request
id. This id is set whenever the permissions connect screen is opened,
ensuring that that tab is for that specific request alone.

This makes handling of multiple permissions requests a bit more
intuitive. Previously whenever opening multiple permissions requests,
the first one would be shown on each successive tab, whereas you
would expect each tab to show the request that prompted the tab to
open. Users may now address permissions request in whichever order
they'd like to, rather than being forced to deal with them
chronologically.
@Gudahtt Gudahtt force-pushed the LoginPerSite-one-request-per-tab branch from 97b5093 to 5f8ceca Compare December 3, 2019 18:25
@Gudahtt Gudahtt requested a review from frankiebee as a code owner December 3, 2019 18:25
@Gudahtt Gudahtt changed the base branch from LoginPerSite to develop December 3, 2019 18:25
@metamaskbot
Copy link
Collaborator

Builds ready [5f8ceca]

@Gudahtt Gudahtt requested review from danfinlay, danjm and rekmarks and removed request for frankiebee December 4, 2019 03:19
@Gudahtt Gudahtt merged commit 63bd422 into develop Dec 5, 2019
@Gudahtt Gudahtt deleted the LoginPerSite-one-request-per-tab branch December 6, 2019 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants