-
Notifications
You must be signed in to change notification settings - Fork 7
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
2084 Bug | Roles Data doesn't refresh #2188
Conversation
✅ Deploy Preview for decent-interface-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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'd like to see an explicit reset
function, rather than just calling setHatsTreeId(null)
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 possible to switch Safes without invoking the HomePage
component at all (via the search bar). Does this work in that case?
There is another place in the app where resetSafeState()
is called. Should this Zustand reset go there, too?
Tested this, the roles don't persist into the next safe
I don't think so. Regardless, all paths to switch safes that I tested didn't persist a previous safe's roles. Also this bug was hard to reproduce in the first place, so while I did test alternate paths, most testing was focused on the reliable edge case where roles were not getting cleared out |
@DarksightKellar what is the mechanism that allows the Zustand stores to reset themselves when a Safe is changed through the search bar, if we're not explicitly doing that? |
@adamgall I think this it's got a daoAddress dependency (and chain id)
|
I don't like relying on this side effect to "clear out" the state. Would prefer that happens more explicitly. |
@adamgall Hmm I think you've gotten too hung up on the "clear out state" semantic. Hear me out:
I don't see any need to, somewhere else, do:
Actually a better argument would be to rename |
Roles state cleanup
@DarksightKellar - to replicate is it as simple as jumping between safe's role pages quickly? |
Reset Safe state when daoAddress is goes null
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.
Approving, but one suggestion
const todayDotLeftMargin = useBreakpointValue({ base: '5vw', md: '1.35rem' }); | ||
const todayDotLeftMargin = useBreakpointValue({ base: '4.5vw', md: '1.15rem' }); | ||
|
||
const isTodaySelected = () => { |
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 returns boolean | undefined
. Can it be cleaned up to only return a 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.
Ah yeah good call
@adamgall / @DarksightKellar - roles jumping between safes issue still appears for me |
This reverts commit f1d189a.
Revert safe reset refactor
This PR fixes an elusive bug: switching safes was not reloading the new safe's roles. IOW, the previous safe's roles would be visible in the new safe's roles page.
Ideally I should've branched off
develop
and used that as this PR's base, but, alas, I branched offroles-0.2.0/streams
instead. Means this fix will make it to develop only when streams does. Not the most terrible thing to have happened in the world, since this was never an urgent bug in the first place.Also snuck in a tiny update I made to the "today" indicator on the
DecentDatePicker
component