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

fix: Add addOwner route and open tx flow #2399

Merged
merged 2 commits into from
Aug 15, 2023
Merged

fix: Add addOwner route and open tx flow #2399

merged 2 commits into from
Aug 15, 2023

Conversation

usame-algan
Copy link
Member

What it solves

Resolves #2381

How this PR fixes it

  • Adds a new route /addOwner that redirects to the /settings/setup page
  • Opens the txFlow with pre-filled address

How to test it

  1. Open /addOwner?safe=<your safe address>&address=<the address you want to add as an owner>
  2. Add owner txFlow opens with the address filled in
  3. Open /addOwner?safe=<your safe address>
  4. Redirected to the settings page but no txFlow opening
  5. Open /addOwner?safe=<your safe address>&address=<an invalid address>
  6. Redirected to the settings page and txFlow opens with the address value but an error for invalid value is displayed

Screenshots

Screenshot 2023-08-15 at 12 17 06

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@github-actions
Copy link

github-actions bot commented Aug 15, 2023

Branch preview

✅ Deploy successful!

https://add_owner--walletweb.review-wallet-web.5afe.dev

@github-actions
Copy link

github-actions bot commented Aug 15, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@usame-algan
Copy link
Member Author

One potential issue I found is that if the user presses Next too fast, the core-sdk might not be loaded yet and it errors out. To fix this we would have to add the useSafeSDK hook in those components and make sure to include it in the setSafeTx useEffect block.

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Looks good. Please run yarn routes to update the routing table.

@katspaugh
Copy link
Member

Tested, it works. ✅

@francovenica
Copy link
Contributor

The cases described in the description are fine
Safe address and owner address takes to the tx flow to add that owner, with the address field already filled. This even work with ENS names.

If the address of the owner is invalid it will prefill it still, but validate the error. Tested this for invalid addresses, addreses that are already owners, the safe itself, wrongly checksummed addresses, addresses with the wrong prefix (addresses with no prefix will adopt the prefix of the current network)

If no owner address is in the URL it takes just to the settings of that safe. This is for both; if the address parameter is not in the URL or if the address parameter has no value

@francovenica
Copy link
Contributor

Issues/question:

Since this is mobile, probably there isn't much room for human error when creating the URL, but still, if you add a wrong address in the safe, instead of an error it will take to this wrong safe:
image

The URL can be used when not an owner or when disconnected. In These two scenarios the form should not be possible to be opened at all.
Note: there is a safeguard in the form, where an error that says "you are not the owner, you cannot execute the tx" is shown, so this issue could be left like it is as long we all agree that that error in the form is enough.
image

@usame-algan
Copy link
Member Author

Thanks for testing @francovenica!

Since this is mobile, probably there isn't much room for human error when creating the URL, but still, if you add a wrong address in the safe, instead of an error it will take to this wrong safe:

I think this is also how it is on prod. For me it shows an error: https://add_owner--walletweb.review-wallet-web.5afe.dev/settings/setup?safe=nothing
Screenshot 2023-08-15 at 17 01 32
The nothin...hing looks weird though. I suggest we create a ticket for it to be fixed. Probably better to not display anything there if the safe can't be loaded.

The URL can be used when not an owner or when disconnected. In These two scenarios the form should not be possible to be opened at all.

It is also possible to get into this state when you disconnect your wallet after going into a tx-flow so I suggest to leave it as it is.

@francovenica
Copy link
Contributor

Ah, ok, so these are existing issues.

I'll report the wrong safe address not being rejected by the app in another ticket.

We can pass this one

@usame-algan usame-algan merged commit 92c2864 into dev Aug 15, 2023
7 checks passed
@usame-algan usame-algan deleted the add-owner branch August 15, 2023 15:21
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2023
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.

Linking to the 'add owner' screen
3 participants