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

Revert safe reset refactor #2219

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

DarksightKellar
Copy link
Contributor

In a previous commit, we moved the calls to resetSafeState and resetHatsStore from the home page to the dao controller component, as that felt like the more logical place to put it.

While the argument is still valid, this just led to more bugs due to the brittle nature of the flow of safe state changes.

We have tried moving the resets higher up the hierarchy into Layout/index.tsx with slightly better result, but far from good enough.

That said, the decision was made to revert this move for now. This fixes the original bug described in #2084, with the caveat that there are edge cases around switching safes instantly using the search bar, when already on the roles page of the current safe.

This will have to do for now as the most common UX flows to end up on different safes should be fine. I do plan to continue to dig into the original safe state issues in the meantime until more pressing issues get on the radar.

Copy link

netlify bot commented Aug 8, 2024

Deploy Preview for decent-interface-dev ready!

Name Link
🔨 Latest commit 40fcf85
🔍 Latest deploy log https://app.netlify.com/sites/decent-interface-dev/deploys/66b4ad12843c930008a280f2
😎 Deploy Preview https://deploy-preview-2219.app.dev.decentdao.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@DarksightKellar
Copy link
Contributor Author

@tomstuart123 Could you checkout the description on this PR please and test to confirm the fix on your end?

@DarksightKellar DarksightKellar requested review from adamgall and a team August 8, 2024 11:47
Copy link
Contributor

@mudrila mudrila left a comment

Choose a reason for hiding this comment

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

Kinda sad but well
We need some refactoring into our state management 🤣

@tomstuart123
Copy link

@DarksightKellar thanks man, very clear description

I just jumped between Safe's via the homepage-->DAOhome-->DAO roles--> homepage --> etc. This worked 100% of the time on 6 tries.

I was able - as you mentioned to replicate the edge case you mentioned with the search bar. However, I can confirm that this is fine. To replicate it you need to move super fast in the UI (i.e. power users) and even then it does reload automatically eventually

Approved

@tomstuart123
Copy link

Question @DarksightKellar / @decentdao/engineering -

will this reverted change of 'call' location have any other user impact? Or was it just a general 'code efficiency' / 'logical place' reason ?

@DarksightKellar
Copy link
Contributor Author

Question @DarksightKellar / @decentdao/engineering -

will this reverted change of 'call' location have any other user impact? Or was it just a general 'code efficiency' / 'logical place' reason ?

@tomstuart123 Yeah this revert just sent back logic to the way it was already on develop. Plus the "fix" on top of that. The move (that ended up not working out) was meant to patch up edge case resetting logic flaws that do exist right now regardless and were discovered while fixing the original issue.

For example, having the reset logic exist in the homepage means that going to the homepage is the only to reliably reset safe state. If the "homepage" changes at some point in the future, that affects this guarantee.

@DarksightKellar DarksightKellar merged commit 3b89526 into 2084-reload-roles Aug 8, 2024
7 checks passed
@DarksightKellar DarksightKellar deleted the revert-safe-reset-refactor branch August 8, 2024 14:45
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.

3 participants