Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

(Fix) Modules not shown in Advanced Settings#1516

Merged
fernandomg merged 13 commits intodevelopmentfrom
fix/1494-modules-not-shown
Oct 27, 2020
Merged

(Fix) Modules not shown in Advanced Settings#1516
fernandomg merged 13 commits intodevelopmentfrom
fix/1494-modules-not-shown

Conversation

@fernandomg
Copy link
Contributor

@fernandomg fernandomg commented Oct 21, 2020

This PR closes #1494, by changing the way modules information is retrieved.

The error: was in assuming that getModulesPaginated was present in all Safe's versions, but it wasn't implemented until v1.1.1.

The fix changes the strategy by using the SafeInfo (safes/{safeAddress}) transactions service endpoint, which returns modules information and more.

The only restriction that the transaction service has is that it's using getModules method, which in versions >=v1.1.1 will return up to 10 modules.

So, if we face that scenario, we'll be querying getModulesPaginated as a last resource.

More info at https://github.com/gnosis/safe-react/blob/fix/1494-modules-not-shown/src/logic/safe/utils/modules.ts#L40

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@fernandomg fernandomg changed the title (Fix) Modules not shown (Fix) Modules not shown in Advanced Settings Oct 21, 2020
@github-actions
Copy link

github-actions bot commented Oct 21, 2020

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 2 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@ghost
Copy link

ghost commented Oct 21, 2020

Travis automatic deployment:
https://pr1516--safereact.review.gnosisdev.com/app

@fernandomg fernandomg requested a review from dasanra October 23, 2020 00:13
@ghost
Copy link

ghost commented Oct 23, 2020

Travis automatic deployment:
https://pr1516--safereact.review.gnosisdev.com/app

* @returns Array<ModulePair> | null | undefined
*/
export const getModules = async (safeInfo: SafeInfo | void): Promise<Array<ModulePair> | null | undefined> => {
if (safeInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you inverse the condition? if (!safeInfo) that will remove 1 nested level

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done this

@nicosampler
Copy link
Contributor

@fernandomg there are some conflicts

# Conflicts:
#	src/config/index.ts
#	src/logic/currencyValues/api/fetchTokenCurrenciesBalances.ts
@ghost
Copy link

ghost commented Oct 23, 2020

Travis automatic deployment:
https://pr1516--safereact.review.gnosisdev.com/app

@ghost
Copy link

ghost commented Oct 26, 2020

Travis automatic deployment:
https://pr1516--safereact.review.gnosisdev.com/app

@ghost
Copy link

ghost commented Oct 26, 2020

Travis automatic deployment:
https://pr1516--safereact.review.gnosisdev.com/app

@francovenica
Copy link
Contributor

Tried in a safe 1.0.0

Safe: https://pr1516--safereact.review.gnosisdev.com/app/#/safes/0xeca13481F8514752dC08106c7A265c85caFa563E/settings
In the dev env:
image.png

After the fix, in the PR:
image.png

@francovenica
Copy link
Contributor

There is a issue with tx not being able to be executed when a tx is "off chain", it fails on its first signature.
With Fer we were checking what it was and it seems there is an "/" missing in the URL where the post is being done.

@fernandomg
Copy link
Contributor Author

There is a issue with tx not being able to be executed when a tx is "off chain", it fails on its first signature.
With Fer we were checking what it was and it seems there is an "/" missing in the URL where the post is being done.

@francovenica fixed, thanks so much for the catch!

@ghost
Copy link

ghost commented Oct 26, 2020

Travis automatic deployment:
https://pr1516--safereact.review.gnosisdev.com/app

Copy link
Contributor

@matextrem matextrem left a comment

Choose a reason for hiding this comment

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

LGTM👍

@francovenica
Copy link
Contributor

Tried again In this safe https://pr1516--safereact.review.gnosisdev.com/app/#/safes/0x9913B9180C20C6b0F21B6480c84422F6ebc4B808/transactions

I was able to do a regular "Send Funds" tx and add the module that Tobias pointed out in the issue ticket.

Looks good to me

@francovenica francovenica self-requested a review October 27, 2020 13:47
@fernandomg fernandomg merged commit aa181fb into development Oct 27, 2020
@fernandomg fernandomg deleted the fix/1494-modules-not-shown branch October 27, 2020 14:04
@github-actions github-actions bot locked and limited conversation to collaborators Oct 27, 2020
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.

Enabled module not displayed in advanced settings

5 participants