-
Notifications
You must be signed in to change notification settings - Fork 15
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: update list paddings, load all stakes regardless of colonies, update redirect to stakes #2759
Conversation
Is this ready for review? |
No, it is in progress. |
a8934cf
to
7ab3f3b
Compare
@@ -0,0 +1,189 @@ | |||
import { |
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.
I would really appreciate for review this file and any comments are welcome, it kinda duplication for https://github.com/JoinColony/colonyCDapp/blob/master/src/hooks/useNetworkMotionStates.ts
But I tried to do it for all user colonies, not only for the current one
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.
Good shout with a separate hook for all colonies. I think it can be simplified a bit further to roughly follow this flow:
- Get all installed extensions for joined colonies
- Select all voting reputation addresses (directly from the query data, you shouldn't need any mapping)
- Get network states for each of the motions
- Create a map between motion database IDs and states so that a flat map can be used
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.
Nice start to this issue, it is definitely more complicated than it initially appeared! I think the estimate should definitely go up from 4 hours.
All the UI fixes look great, looking much tidier now!
![Screenshot 2024-07-26 at 11 34 54](https://private-user-images.githubusercontent.com/34915414/352512577-14169ffb-0f08-42e9-919f-d806024b897d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTI1MTI1NzctMTQxNjlmZmItMGYwOC00MmU5LTkxOWYtZDgwNjAyNGI4OTdkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThhZGE3MDYxNDE3YTIzZWJmMDMyYTcyMGRkYzVjMzVjMjY0ZWI5MTYxMWJkOTkxODdlMzgxMmNmMWM2NjBkY2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ku6EPtTD0TDvzbloY6QKZ47HT9bp6W-fGyCTwjCfFF0)
I did notice the "Claim all stakes" button does not appear on mobile - not sure if this is intended?
![Screenshot 2024-07-26 at 12 19 58](https://private-user-images.githubusercontent.com/34915414/352512181-b2da7149-2784-4b0e-9df5-ebce59d62f0e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTI1MTIxODEtYjJkYTcxNDktMjc4NC00YjBlLTlkZjUtZWJjZTU5ZDYyZjBlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM2ODZiZTJjOTllY2JjNmJiZGNlYjhhMjNjZjJjNTM1M2VhZDcxNzU4Yzc5YzgxNDYxOWY0NDkxMjI3N2FkZDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.S72AJAk0Ovw23DNV8u4uTBH9BkcNEslCKAPMPFgarjo)
There are a few issues I've noticed.
The stake amount should show using the native token for the colony it was created in. Currently it uses the token for the colony you have open.
![Screenshot 2024-07-26 at 11 33 07](https://private-user-images.githubusercontent.com/34915414/352512510-a8095783-e571-422b-bfa9-182c79d4623c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTI1MTI1MTAtYTgwOTU3ODMtZTU3MS00MjJiLWJmYTktMTgyYzc5ZDQ2MjNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ2MjJkOTQxNmIwNDU3MDJjM2NlNDYxZTRlNjdhMTJlM2Y4MmE5ZjVkNmIzMWFmN2IwODkxMmM2MDEzMmY0YmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.I_h_l54nNtiaookLteb1DFXEMpMUlHk5Fpm5wMd1q5I)
Switching to the correct colony is working nicely, great job with that!
Screen.Recording.2024-07-26.at.11.35.07.mov
There is no loading spinner when you first open the userhub after a refresh:
Screen.Recording.2024-07-26.at.12.05.33.mov
This is particularly noticeable on a slower connection - it also initially loads in with the wrong status:
Screen.Recording.2024-07-26.at.12.12.05.mov
There is also this issue when opening the userhub straight after staking a motion. I think this only happens during the few seconds directly after staking a motion so this might not be a big deal and we could address it separately.
Screen.Recording.2024-07-26.at.12.08.16.mov
After uninstalling the extension, all stakes are shown as "uninstalled". I think for the stakes we know have already been claimed, we should still show those as "claimed" rather than setting it as "uninstalled". I personally think "uninstalled" should be shown as "lost" for the stakes that we know were unclaimed when the extension was uninstalled - but this might need checking with @arrenv
![Screenshot 2024-07-26 at 12 13 37](https://private-user-images.githubusercontent.com/34915414/352514693-4e67855a-237e-4035-b9e3-191fcae34f7c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTI1MTQ2OTMtNGU2Nzg1NWEtMjM3ZS00MDM1LWI5ZTMtMTkxZmNhZTM0ZjdjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA0ZWI0OTkwMDZlMDQ1NjI1YmE5NzkwZDM2MDQxMGZkMmFkYWQ2MmM5Mjc0ODMwYzIxOWZmOGVkMmNmYWI3ZTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lhG6y8hIr2onUejEJsrhHZgQqxgIxsWeB6aFsZQPKBw)
After re-installing the extension, new motions created with the new extension are seemingly using the same nativeId (or whatever is being called to check the status), as the old stakes (from the now uninstalled extension) are also being updated.
In this screenshot the bottom one is from the now uninstalled extension, the top one is from the newly installed extension.
![Screenshot 2024-07-26 at 12 15 07](https://private-user-images.githubusercontent.com/34915414/352514956-e305477c-e0ed-4d97-bd87-62664012e971.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTI1MTQ5NTYtZTMwNTQ3N2MtZTBlZC00ZDk3LWJkODctNjI2NjQwMTJlOTcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRhOGJlZWVjM2Q4ZjU4MzE0MDc0ZGU4NGJjZDYyNzY3NjU1YzQxM2RkMjVlZGM4NTljYTI0NDIwMjAwNjc3ODAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8mjSeHkc4edmRk7ohHQo4pGLR2BDva-rCXqQYpjWf7k)
If you have unclaimed stakes across multiple colonies, then the "claim all stakes" button only works for the current colony you are in. It would be great to make this claim stakes across all colonies, or if this isn't possible it should be reworded "Claim all stakes in this colony" or something. The state also doesn't update until the userhub is closed and reopened.
Screen.Recording.2024-07-26.at.12.16.34.mov
Thank you for tackling this complicated issue though! It highlights some of the issues we may have when we make the userhub accessible outside of colonies which will be required as part of the crypto to fiat work.
if (!motionState) { | ||
return UserStakeStatus.Unknown; | ||
const colonyAddress = stake.action?.colonyAddress; | ||
const currentColonyMotionState = statesMap?.get(colonyAddress ?? ''); |
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.
Doesn't need a ?
after statesMap
here
const reputationAddress = | ||
colonyAddress && votingReputationByColony[colonyAddress]; |
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.
Think this variable could have a better name
const stakeColonyName = stake.action?.colony.name ?? ''; | ||
|
||
useEffect(() => { | ||
if (colonyName !== stakeColonyName) { |
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.
Can we compare colonyAddresses here? It is possible for two colonies to have the same name so this is a bad comparison.
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.
Very nice effort with this pretty complex issue @Nortsova
Reducing nesting of the mapping between colony addresses and motions and their states would help improve the overall readability. I think this could be achieved if you can instead create a map between database motion ID (it's unique across colonies and formatted as chainId-votingRepExtnAddress_nativeMotionId
) and their corresponding states.
Please ensure you type the arguments of the functions you add as it reduces the risk of mistakes.
@@ -53,7 +56,7 @@ const StakesTab = () => { | |||
> | |||
<div className="mb-4 flex items-center justify-between sm:px-6 sm:pt-6"> | |||
<p className="heading-5">{formatMessage({ id: 'stakes' })}</p> | |||
{!isMobile && ( | |||
{!isMobile && votingReputationAddress && ( |
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.
What is the purpose of this check? It prevents staked expenditure stakes from being claimed if voting rep is not installed
@@ -15,3 +15,39 @@ query GetExtensionInstallationsCount($id: ID!) { | |||
reputationWeighted | |||
} | |||
} | |||
|
|||
query GetAllColoniesExtensions( |
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.
Perhaps GetJoinedColoniesExtensions
would better describe what it does?
$sortDirection: ModelSortDirection = ASC | ||
$limit: Int = 100 | ||
$nextToken: String | ||
$isWatching: Boolean |
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.
It feels like this argument doesn't belong here anymore, should the query always set the filter to true instead?
const getInstalledExtensions = (colony, versionsData) => { | ||
const colonyExtensions = colony?.extensions?.items?.filter(notNull); | ||
if (!colonyExtensions) { | ||
return []; | ||
} | ||
|
||
const extensionVersions = | ||
versionsData?.listCurrentVersions?.items?.filter(notNull); | ||
|
||
const colonyExtensionsMap = colonyExtensions.map((extension) => { | ||
const extensionConfig = supportedExtensionsConfig.find( | ||
(e) => getExtensionHash(e.extensionId) === extension?.hash, | ||
); | ||
|
||
const { version } = | ||
extensionVersions?.find((e) => e?.extensionHash === extension.hash) || {}; | ||
|
||
// Unsupported extension | ||
if (!extensionConfig || !version) { | ||
return null; | ||
} | ||
|
||
return mapToInstalledExtensionData({ | ||
colony, | ||
extensionConfig, | ||
colonyExtension: extension, | ||
version, | ||
}); | ||
}); | ||
return colonyExtensionsMap.filter(notNull); | ||
}; | ||
|
||
const getVotingReputationAdress = (installedExtensions): string | undefined => { | ||
const votingReputationExtension = installedExtensions.find( | ||
(extension) => extension.extensionId === Extension.VotingReputation, | ||
); | ||
|
||
return votingReputationExtension?.address; | ||
}; |
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.
Is all this processing necessary if you only care about the hash and the address of each colony extensions?
@@ -0,0 +1,189 @@ | |||
import { |
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.
Good shout with a separate hook for all colonies. I think it can be simplified a bit further to roughly follow this flow:
- Get all installed extensions for joined colonies
- Select all voting reputation addresses (directly from the query data, you shouldn't need any mapping)
- Get network states for each of the motions
- Create a map between motion database IDs and states so that a flat map can be used
const sortByDate = <T extends { createdAt: string }>(a: T, b: T) => | ||
new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime(); | ||
|
||
const useJoinedColoniesWithExtensions = (userAddress?: string) => { |
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 hook seems very specific to useNetworkMotionStates
, I would either make it a helper or place it next to that hook to indicate it's not intended to be reusable
I noticed an error that I can't manually repeat. It happen for this request:
I also tried to do it with check |
A scenario for signerOrProvider error found, here is another bug with the same issue - #2643 |
d5c1654
to
7710c45
Compare
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.
Really great work on this @Nortsova ! 🎉 This definitely hasn't been an easy issue, so fantastic job on getting this to work so nicely!
Truncation looks good on both desktop and mobile:
![Screenshot 2024-08-07 at 09 46 45](https://private-user-images.githubusercontent.com/34915414/355752427-6f29947f-ece6-4d48-8cca-8d87a5780d5b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTU3NTI0MjctNmYyOTk0N2YtZWNlNi00ZDQ4LThjY2EtOGQ4N2E1NzgwZDViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM1NGVjNmZjNDYwZTM5NTdjNzM5YWFmYTg0NjMzOTk1N2ZmZmZkYTcwZTBiOThkN2Y5MjllNTk4YTU5NDUyMTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7oXh-zMBAys31SMO-ASAmKxbv9Ps1FRJvMp8HUGTnn4)
![Screenshot 2024-08-07 at 09 47 06](https://private-user-images.githubusercontent.com/34915414/355752521-53eaa6f2-c3f3-436f-9d70-23d44c7db298.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTU3NTI1MjEtNTNlYWE2ZjItYzNmMy00MzZmLTlkNzAtMjNkNDRjN2RiMjk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiNTMzNDNiNGVjNTViYzlmMzg3OGQzZTc5YmY0N2ExYTA4Mzc3ZWNiNTNlMWY5YzQ4ZGMwMGVhYTFhMDc2Y2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.CY_3TKOJMZx_izQtFTf4H5uw458dmD6K-FL2fLOj4AM)
The motion pills in the different states as viewed from another colony:
![Screenshot 2024-08-07 at 09 54 23](https://private-user-images.githubusercontent.com/34915414/355752829-156caba7-6988-4c76-8262-24689fa60080.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTU3NTI4MjktMTU2Y2FiYTctNjk4OC00Yzc2LTgyNjItMjQ2ODlmYTYwMDgwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJiZDA2ZWFlMDY3NTQzY2Q4MzU2Njg4MTQ4M2YzMGE3ZDc1Y2E2YTJkZDkxZmQwYjM1NWMxN2Y4MDI2Y2M2YTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vhmJnBQP2T_jb-NHI0qjGk88kv1AjEdlmaTubP90_SE)
Claiming all with stakes in different colonies works without a hitch. I also tested this from a completely new colony where the extension has never been installed before and was able to claim a stake from another colony via "claim all". 🎉 Nice work adjusting the saga to accommodate the different colony and extension addresses.
Screen.Recording.2024-08-07.at.09.55.39.mov
Statuses show correctly after the extension has been uninstalled and reinstalled, and stakes open the correct transaction when clicked.
![Screenshot 2024-08-07 at 09 58 59](https://private-user-images.githubusercontent.com/34915414/355755493-96179dcf-1c27-43be-a2c6-ac7a67e2e3a0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTU3NTU0OTMtOTYxNzlkY2YtMWMyNy00M2JlLWEyYzYtYWM3YTY3ZTJlM2EwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQzNzFjOTA1YWVmNWY3N2M0N2ZhOGQ2NWRjOGJhZTZhYTA5MDQ5ODZkNzgzNGE1MWMyMWFmNmRkN2YyNjRhZjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.eiduCDaAXYCfxSNyEvsuRBxk1N9cJ8kpnxPc0axrlD0)
I've only found two major issues. The first is if you have no voting reputation extension installed in a colony that has old motions, the stakes will fail to load:
Screen.Recording.2024-08-07.at.09.56.27.mov
Once a new version of the extension is installed, they will load again. (This issue still happens if you switch to another colony where the extension is installed).
There is also this console warning which it would be great if you could look into and resolve. I'm not sure how this could affect other parts of the app if left as is.
![Screenshot 2024-08-07 at 10 05 36](https://private-user-images.githubusercontent.com/34915414/355756043-cfaec399-f11f-4847-bd93-81e4bcdbbad1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zNDkxNTQxNC8zNTU3NTYwNDMtY2ZhZWMzOTktZjExZi00ODQ3LWJkOTMtODFlNGJjZGJiYWQxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0NjI2NWJjMWI2NzRmZGM3NzA0ZjU4YWQ0N2UzYzAzOWE1NjZkYjczNWI0Yjg5ODlmNDZiZjllOTk2N2RhMDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.gDPdqwlskJgcgqBFBmXSVpEqOVE_T8mYQ9G_4AaYIpY)
I'm guessing it has something to do with how getContributorsByAddress
is being used to get all the colony extensions.
src/redux/types/actions/motion.ts
Outdated
motionIds: { | ||
databaseMotionId: string; | ||
colonyAddress: string; | ||
extensionAddress: string; | ||
}[]; |
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.
I wonder if there is a better name than motionIds
now that this is an object
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.
Good catch, @iamsamgibbs ! thanks!
a1eb500
to
45a6745
Compare
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.
Thank you for addressing my previous feedback @Nortsova, feels like it's not very far off.
I left a couple of comments, but overall you've done a great job so far. Nice work 💪
motionIds: claimableStakes.map( | ||
(stake) => stake.action?.motionData?.databaseMotionId ?? '', | ||
), | ||
motionStates: claimableStakes.map((stake) => ({ |
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.
Should this be called something like userStakes
instead? It's not only motions (expenditures can have stakes too)
@@ -84,6 +95,7 @@ const ActionSidebarContextProvider: FC<PropsWithChildren> = ({ children }) => { | |||
); | |||
|
|||
const toggleOff = useCallback(() => { | |||
removeTxParamOnClose(); | |||
return toggleActionSidebarOff(); | |||
}, [toggleActionSidebarOff]); |
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.
There's a warning from GH build
action about missing dependency in this line
src/graphql/queries/stake.graphql
Outdated
} | ||
} | ||
|
||
query GetUserStakesByColony($userAddress: ID!, $colonyAddress: ID!) { |
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 isn't used anywhere now, so let's remove it 🗑️
|
||
export type MotionStatesMap = Map<string, MotionState | null>; | ||
|
||
export type MotionStatesMapByColonies = Record<string, MotionStatesMap>; |
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.
Looks unused
const { | ||
joinedColoniesWithExtensions, | ||
loading: joinedColoniesWithExtensionsLoading, | ||
} = useJoinedColoniesWithExtensions(wallet?.address); | ||
|
||
const votingReputationByColony = useMemo(() => { | ||
return joinedColoniesWithExtensions.reduce((prev, colony) => { | ||
if (!colony) { | ||
return prev; | ||
} | ||
return { | ||
...prev, | ||
[colony.colonyAddress]: getVotingReputationAddressByColony(colony), | ||
}; | ||
}, {}); | ||
}, [joinedColoniesWithExtensions]); |
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.
Maybe moving the useMemo
block to the useJoinedColoniesWithExtensions
hook would make the body of this hook a bit lighter?
return !motionStatesMap.has(motion.databaseMotionId); | ||
}); | ||
const deletedMotionIds = Array.from(motionStatesMap.keys()).filter( | ||
(nativeMotionKey) => |
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.
Please update the naming to indicate if it is the native ID or database ID. It should be database ID as only those are unique between colonies
const statesMap = new Map(motionStatesMap); | ||
|
||
await Promise.all( | ||
newMotionIds.map(async (nativeMotion) => { |
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.
I'm not sure about nativeMotion
, why such name?
deletedMotionIds.forEach((nativeMotionId) => | ||
statesMap.delete(nativeMotionId), | ||
); |
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.
Please update naming here as well
useGetFullColonyByAddressQuery({ | ||
variables: { | ||
address: stake.action?.colonyAddress || '', | ||
}, | ||
fetchPolicy: 'network-only', | ||
nextFetchPolicy: 'cache-first', | ||
}); |
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.
It's an expensive query to be making for each stake in the list, I think the best thing to do here would be to modify the UserStake
model to include a reference to colony
field. You can then extract just the native token and its decimals in one go.
You could go a step further if you wish and fetch the extensions in the UserStake fragment as well. The benefit of such approach is that it would also work for stakes in colonies that the user has subsequently left.
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.
Thanks for fixing the issues I raised! I've not seen the console warning and the code fixes for that make sense.
I've also tested the stake loading when there is no extension installed which is working now!
Screen.Recording.2024-08-08.at.09.12.37.mov
Once you've fixed up the comments Jakub has left I'll drop an approval on this.
Unrelated to this PR, but the activity feed will need a similar fix to what you have done here as it tries to load the old motion data through the new extension:
Screen.Recording.2024-08-08.at.09.15.16.mov
It also doesn't support the new "Lost" pill and will just show "Unknown" so we'll need to update this at a later point.
Thank you @iamsamgibbs! This is a really important note. I created a ticket for Activity Feed - #2907 |
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.
nativeToken: { | ||
decimals: stake.action?.colony.nativeToken.nativeTokenDecimals, | ||
symbol: stake.action?.colony.nativeToken.nativeTokenSymbol, | ||
tokenAddress: stake.action?.colony.nativeToken.tokenAddress, | ||
name: stake.action?.colony.nativeToken.name, | ||
}, |
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.
Could this just be nativeToken: state.action?.colony.nativeToken
?
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.
A lot of effort went into this PR so kudos to you @Nortsova.
I can see my stakes from across all colonies and navigate between them:
Screen.Recording.2024-08-13.at.16.18.04.mov
After uninstalling voting rep, the status shows as Lost:
Finalizable and claimable statuses also work fine:
![image](https://private-user-images.githubusercontent.com/112586815/357447521-703a83ef-715e-4d52-9368-706c998e6c52.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8xMTI1ODY4MTUvMzU3NDQ3NTIxLTcwM2E4M2VmLTcxNWUtNGQ1Mi05MzY4LTcwNmM5OThlNmM1Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQwNjQzMjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zZTFjYTMwNzU4YWNlMmE3MjFkY2M3OTg1NWZiNDI5OGNmNDhhMmEzNzkxOWFiN2U5MGU4ZTZmZThmZDdlNTM1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.3oSSKaBlS28grdSkOw1ATahkLOAuJzVaXKRvAG4lwmw)
I left a couple of comments but they're nothing major, so thumbs up from me 👍 Very nice work 💯
<button | ||
type="button" | ||
onClick={() => | ||
navigate( | ||
`${window.location.pathname}?${TX_SEARCH_PARAM}=${stake.action?.transactionHash}`, | ||
setQueryParamOnUrl( | ||
navigatePath, |
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.
Do we need a state for this or can we just use stakeColonyName
here? Would make it a bit simpler to read without the state and useEffect
src/hooks/useNetworkMotionStates.ts
Outdated
@@ -7,6 +7,7 @@ import { useAppContext } from '~context/AppContext/AppContext.ts'; | |||
import useEnabledExtensions from './useEnabledExtensions.ts'; | |||
|
|||
export type MotionStatesMap = Map<string, MotionState | null>; | |||
export type VotingReputationByColonyId = Record<string, string>; |
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.
nit-picking, Id
should be Address
instead to avoid confusion
const currentExtensionAddress = colonyExtensions.find((extension) => { | ||
const extensionConfig = supportedExtensionsConfig.find( | ||
(e) => getExtensionHash(e?.extensionId) === extension?.hash, | ||
); | ||
return extensionConfig?.extensionId === Extension.VotingReputation; | ||
}); | ||
return currentExtensionAddress?.address; |
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.
const currentExtensionAddress = colonyExtensions.find((extension) => { | |
const extensionConfig = supportedExtensionsConfig.find( | |
(e) => getExtensionHash(e?.extensionId) === extension?.hash, | |
); | |
return extensionConfig?.extensionId === Extension.VotingReputation; | |
}); | |
return currentExtensionAddress?.address; | |
const votingRepExtension = colonyExtensions.find( | |
(extension) => | |
extension.hash === getExtensionHash(Extension.VotingReputation), | |
); | |
return votingRepExtension?.address; |
getExtensionHash
can be imported from colony-js
|
||
/** | ||
* Hook that accepts an array of UserMotionStake and returns a map of motion IDs to their states | ||
* Make sure to memoize the array of motion IDs to avoid infinite loops |
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 comment seems no longer relevant
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.
Tested and everything works as expected, at least the part that you fixed in this PR. Very good work Anastasiia! 💯
I did found something however, but something that's not really a issue related to this PR.
While a very long (multiple words) title shows up correctly, a title that contains a non-breakable word (no spaces) will break both the actions list UI as well as the action sidebar
I do want to note however, that it shows correctly in the Userhub where you fixed it in this PR
… it close related functions
…oring for checking url
…r on voting reputation connection
7dd8791
2a11ea5
to
7dd8791
Compare
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.
Wow, really impressive work @Nortsova 🥇 Thank you for tackling this issue 🤩
Went through the testing steps and can confirm the required changes are in place
Screen.Recording.2024-08-14.at.10.27.33.mov
![Screenshot 2024-08-14 at 10 28 22](https://private-user-images.githubusercontent.com/32430018/357744481-b4d2a7fa-958d-40a7-833a-b3bee0a94476.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zMjQzMDAxOC8zNTc3NDQ0ODEtYjRkMmE3ZmEtOTU4ZC00MGE3LTgzM2EtYjNiZWUwYTk0NDc2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZkOWQyZjEyYWEyNThhMTVhYTZmZjEyNTYzMzM4MjM5ODNjNzRjNTgxOWZhYmJmNzk0Zjc5ZGNiNmQ3ODI5NWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.meDMeuekWP2ra9UuId5yXjm4C_6g3qn2OvFrAJwE_3g)
![Screenshot 2024-08-14 at 10 28 34](https://private-user-images.githubusercontent.com/32430018/357744486-30ad316a-5663-4885-9210-e2d59456d44b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zMjQzMDAxOC8zNTc3NDQ0ODYtMzBhZDMxNmEtNTY2My00ODg1LTkyMTAtZTJkNTk0NTZkNDRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc3YzRhOWQ0MDUxMjY0YWUxN2E4ZjM5MTM2ZGVkYjhiZTQyMzQzNTkwODJhYjQ1ZDE4MzgyOGQ2N2ZmMTE5ODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nzVf1PhtzvT2WHjoSuZYFhdshGPfGzN5zvkRdqk6f34)
![Screenshot 2024-08-14 at 10 29 14](https://private-user-images.githubusercontent.com/32430018/357744490-02502591-ebbb-4ebd-90cc-4149e39a84f6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zMjQzMDAxOC8zNTc3NDQ0OTAtMDI1MDI1OTEtZWJiYi00ZWJkLTkwY2MtNDE0OWUzOWE4NGY2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQxM2JlM2VlNTJjMTVmNjBkZmE0NDQ0ZDQ2MWU0NTEwOTI3MDcxNjVmZGFkZWZjYTY4MGFhNmRkYzNhOTYxODImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.EcFdWDQ9_YN0X8sa_wWKzHdGkd9ijBLJDRh1VRrMq7c)
![Screenshot 2024-08-14 at 10 29 22](https://private-user-images.githubusercontent.com/32430018/357744493-5c15218b-7782-40da-baa6-4c5fdebb2a1f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zMjQzMDAxOC8zNTc3NDQ0OTMtNWMxNTIxOGItNzc4Mi00MGRhLWJhYTYtNGM1ZmRlYmIyYTFmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM3ODBmYjY1MzMzYzI5MjM0OWRmZGExMGIyM2IwMjJmNDkwYmFlYmYyYTBmNTM0MDM1MDllMDg0NjU5YWJiZjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-QWs6AdT_hBxvnUH7sk_6_PjASICJcmxPND4XOj1AU4)
![Screenshot 2024-08-14 at 10 30 34](https://private-user-images.githubusercontent.com/32430018/357744498-c6fe1adc-a080-4977-b7b1-373b34675372.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zMjQzMDAxOC8zNTc3NDQ0OTgtYzZmZTFhZGMtYTA4MC00OTc3LWI3YjEtMzczYjM0Njc1MzcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJhZWVkMDNlNmJkOGYwZWYzOGFlODcwYjlkZTkyMDlkYTMyZmNjMjY0MDNhNmZlMmZjZTUzMTAxMTNkOWRlYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bp8K6jENXtEIPsIqNwWP8ZyyQaXPMIHDtNsqquNb7bA)
Screen.Recording.2024-08-14.at.10.34.36.mov
However, I noticed claiming all stakes was not possible from the User Hub 😢
Can you please check?
Screen.Recording.2024-08-14.at.10.35.49.mov
![Screenshot 2024-08-14 at 10 36 03](https://private-user-images.githubusercontent.com/32430018/357745180-8a51022d-9f3f-4b90-8946-04912393859b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDUsIm5iZiI6MTczOTI1NjIwNSwicGF0aCI6Ii8zMjQzMDAxOC8zNTc3NDUxODAtOGE1MTAyMmQtOWYzZi00YjkwLTg5NDYtMDQ5MTIzOTM4NTliLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJiMmMzODk0ODY5MmQ5ZTk4MWQwNzQxNzUyYjVkNGE5MzcwMmM3OTUxMTdjZDk5YTg5NTFkNWE3ZjA2ODQwZmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-UZhwoASwLVDHidjJs3-DuKAPpuaePi4bJzVNTG1K0A)
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.
There was an issue with my env, can confirm also the claiming all stakes is working
Screen.Recording.2024-08-14.at.14.32.15.mov
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.
Description
Testing
Step 1. Create actions with reputation decision method, title should be long
![image](https://private-user-images.githubusercontent.com/15706494/352445095-d89cdd18-f80c-4cd1-82c2-e7217801fc01.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTI0NDUwOTUtZDg5Y2RkMTgtZjgwYy00Y2QxLTgyYzItZTcyMTc4MDFmYzAxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5YWQ1YzllYjdhNzg3NTBhYzMzMzAyMWNiYjc0MjQ0ZjJmYzZkNjIyZjc5M2MxYjU5ZDUwZjE0OTY5ZjhhMWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.gcIXuFN0JUmf-eBZCa07G3L4h35hl6oIVCEPNBsJ0Jw)
![image](https://private-user-images.githubusercontent.com/15706494/352445538-7b55217e-d600-4c36-9e6f-2214461038e4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTI0NDU1MzgtN2I1NTIxN2UtZDYwMC00YzM2LTllNmYtMjIxNDQ2MTAzOGU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUzNThmNmQ2NTc5Y2FlZDg4YWI2Y2E1MWY2MzUzMzliZDM2NTRiNjdjYmI4YzFjYmRlNzE5YWM5MmJkMTNjMDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oaZbASnUd8SCsyVQFLLX2YNFqNj1miZwV51q5xifnL0)
![image](https://private-user-images.githubusercontent.com/15706494/352447257-9a963fd0-6ef0-4d04-bbb3-25451cadd5ab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTI0NDcyNTctOWE5NjNmZDAtNmVmMC00ZDA0LWJiYjMtMjU0NTFjYWRkNWFiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0YmIwZjExMWExNjQ4YmNmYzNhNjViZWMwZWEyYjJjNzZkYzg3ZDAxZjZmNTFmZGRjYmIyNTM5NDk4OTdhYjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.eQ8dzDn5kUon4Y7u33MQRf8NYPUxnL1QoZIGviFAXAg)
![image](https://private-user-images.githubusercontent.com/15706494/352447435-f904e2c3-1d4d-4783-9194-09bc92d245a2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTI0NDc0MzUtZjkwNGUyYzMtMWQ0ZC00NzgzLTkxOTQtMDliYzkyZDI0NWEyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA0ODZiMzM1YTQ2YjEwNGExNDY5OWIyYzE2ZDZmNDUzMzc2ZWQ5OGUyMjZiOTgyY2VmNDhlZmI3YjFkNWM5NTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oNTgQ2fv4TKhXp9S19YOtT3tTsNMjzVtXbhyW6mgMO0)
![image](https://private-user-images.githubusercontent.com/15706494/352450797-effe8dee-cc51-4332-8864-504ea4965f8a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTI0NTA3OTctZWZmZThkZWUtY2M1MS00MzMyLTg4NjQtNTA0ZWE0OTY1ZjhhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdhNjU5NDhmOTgwMThkZDJkMGY0MGNhNjdmMGE4ZWUzOWU0NzJlYTZhMWRlZDFmODUzZjM4NDQ4ZjcxNGI2ZWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.031B43wXwcyu4aKgEeNDD_pNT9a1KsOkt4DWCZKHuhM)
![image](https://private-user-images.githubusercontent.com/15706494/352453238-e3dbde62-f61f-46ca-9fb7-5847b160cf1e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTI0NTMyMzgtZTNkYmRlNjItZjYxZi00NmNhLTlmYjctNTg0N2IxNjBjZjFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5MDg4OWM4NzZmMjhjZDc4ZjExMTMyYTFmNDI4YjQ2OWQ3YWFkM2I3ZjJiM2U4YTNmY2M3OGVlODZmYjNlMDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.6bFkHP3N3hkos6SZK1UiXs6XiOu71uCa2OILjxMxUEw)
![image](https://private-user-images.githubusercontent.com/15706494/355501582-2378a170-5e80-49b6-bce5-78b00230f499.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTU1MDE1ODItMjM3OGExNzAtNWU4MC00OWI2LWJjZTUtNzhiMDAyMzBmNDk5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwNWRlZDIyODFjZjdlZDZjNmZjNGUzYzFhYWFkZmQ1ZWFjMjQ2MDU0YTgxMWZjMjE1ODJjZGVhMjY4YzYwZTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.15V9APDM98yOnuwETn-0U0zTb1Q4IoxgwAf6qNUyuZU)
Step 2. Stake this motion
Step 3. Go to UserHub
Step 4. Create different motions on different stages (Claimable, Claimed, Finalizable, Pending)
Ensure that styles are correct here
Step 5. Go to another Colony (wayne) and open UserHub
Ensure that even tho Reputation extension is not installed, you can see stakes from all colonies
Step 6. Enable Reputation Extension for Wayne colony
Step 7. Create new Staking motion in Wayne colony
Step 8. Check UserHub to see all motions
Step 9. Click to motion from different colony and see that you will be redirected
Step 10. Uninstall Reputation Extension and go to UserHub (update: now Uninstalled became "Lost" status)
(Full uninstalled functionality done in #2737)
Step 11. Create stakes, uninstall VotingReputation. Install it again. All not claimed stakes should have status "Lost".
Step 12. Create motions in different colonies and finalize them. You will see "Claimable" status
![image](https://private-user-images.githubusercontent.com/15706494/355196884-6dac8750-a251-4d4a-89fc-94fc31661294.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTUxOTY4ODQtNmRhYzg3NTAtYTI1MS00ZDRhLTg5ZmMtOTRmYzMxNjYxMjk0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlkYmZlZmE0OGY4OWE4ODBmNzYyMTRhYjE5MDdiOGVjMmQ4MDVkZjU5ZmY3YzUxODZhZjMzNGEzNThjMWQzMjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.i0tf9D4ic5w8p5nhoATj5_aa2BYb9K9t0AulUFnzi3w)
![image](https://private-user-images.githubusercontent.com/15706494/355197110-6c2768c7-524f-4b76-aef5-096fd5eb9ad0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTUxOTcxMTAtNmMyNzY4YzctNTI0Zi00Yjc2LWFlZjUtMDk2ZmQ1ZWI5YWQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk3N2MzMTJkOGQwMzRkZjEzNzQ0YmJiYTU3ZmQ4YWQyMjRkODQ4NWQzODU5M2E4MjFjM2Q2MzJkMmZhMzYzYTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.h69KqbSRgQ1cPLiEo4ZOAPuRWpVYZ7KSCC_NAU6wmjc)
![image](https://private-user-images.githubusercontent.com/15706494/355231926-ac9298e6-08ff-437e-a4cc-d78c07494f56.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTY1MDMsIm5iZiI6MTczOTI1NjIwMywicGF0aCI6Ii8xNTcwNjQ5NC8zNTUyMzE5MjYtYWM5Mjk4ZTYtMDhmZi00MzdlLWE0Y2MtZDc4YzA3NDk0ZjU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2NDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJjYzZjMjg2NGMyZjJlNDY5NGI4YmViY2U2NzkyNDA0ZGI5ODI4NTU4NWU3OTY5ODhiZDYzOWQzMjEyZjE4YzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oEK5pKPImxjGuEQDDwM5jx_LSZD-PUFAxSMV9_54XXY)
Step 13. Press the "Claim all" button and ensure that motions in both colonies claimed.
Step 14. Create motion and during pending and processing - open UserHub/Stakes tab
It shouldn't blink. (Sam found this bug in this review - #2759 (review))
Step 15. Disconnect and connect wallet. Open UserHub - stakes should have correct statuses, not "Lost"
Diffs
New stuff ✨
Bug fixed:
After Step 8 click on motion from other colonies.
It was a bug with tx param, it was removed and the user was redirected to the colony page instead of motion page. Now it open the correct link
Resolves #2566