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 DAO name doesn't update after edit #1530

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

DarksightKellar
Copy link
Contributor

This PR removes the local storage of the DAO name. Since this data apparently exists on a subgraph, it's auto-updated (after some time).

There isn't much of a tradeoff in completely removing the DAO name cache. There was a split second where, in the breadcrumbs, the name would be empty while being fetched. I have replaced this with the DAO address substring, so it's less jarring.

@DarksightKellar DarksightKellar linked an issue Apr 9, 2024 that may be closed by this pull request
Copy link

netlify bot commented Apr 9, 2024

Deploy Preview for fractal-dev ready!

Name Link
🔨 Latest commit 5e6d4ce
🔍 Latest deploy log https://app.netlify.com/sites/fractal-dev/deploys/6615a1661ab4ad0008e8bf7d
😎 Deploy Preview https://deploy-preview-1530.app.dev.fractalframework.xyz
📱 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 DarksightKellar requested a review from Da-Colon April 9, 2024 14:33
@DarksightKellar DarksightKellar added the bug Something isn't working label Apr 9, 2024
@DarksightKellar DarksightKellar changed the title [BUGFIX] DAO name doesn't update after edit Fix DAO name doesn't update after edit Apr 9, 2024
Copy link
Member

@adamgall adamgall left a comment

Choose a reason for hiding this comment

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

Looks like you left in code that fetches cached DAO name from local storage. Can we remove that, too?

@DarksightKellar
Copy link
Contributor Author

Looks like you left in code that fetches cached DAO name from local storage. Can we remove that, too?

@adamgall ah yes, thanks for catching that. All done

@DarksightKellar DarksightKellar requested a review from adamgall April 9, 2024 20:23
Copy link
Member

@adamgall adamgall left a comment

Choose a reason for hiding this comment

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

I would encourage you to keep going even deeper.

Does the logic in useDAOName make sense?
Do all the code paths get hit?
What are the actual differences between useDAOName and useLazyDAOName? Can we consolidate those functions into one thing?

Keep in mind my questions here are not rhetorical, I don't know the answers to them, I'm just superficially looking at the code and doing some searches for where these hooks/functions are being used and it seems ripe for some cleanup.

@DarksightKellar
Copy link
Contributor Author

Does the logic in useDAOName make sense? Do all the code paths get hit? What are the actual differences between useDAOName and useLazyDAOName? Can we consolidate those functions into one thing?

Ah yeah I'm glad you brought this up, because I had similar questions too but focusing on understanding and fixing both code and bug ended up sidelining it, and I forgot.

I'd rather this potential cleanup not block this PR though. I would like to spend some time testing and working out what the hooks do differently, if they're both needed, and what a consolidated single hook might look like, but in a follow up PR.

@tomstuart123
Copy link

From a quick look at our leading DAOs, everything seems to work as expected - no issue from my side

@adamgall adamgall requested a review from tomstuart123 April 10, 2024 15:38
Copy link
Contributor

@Da-Colon Da-Colon left a comment

Choose a reason for hiding this comment

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

Awesome, LGTM!

@DarksightKellar
Copy link
Contributor Author

Thanks for the reviews guys. New issue created for the refactoring here: #1531 (comment)

@DarksightKellar DarksightKellar merged commit 711987c into develop Apr 11, 2024
7 checks passed
@DarksightKellar DarksightKellar deleted the 1482-dao-name-doesnt-update-correctly branch April 11, 2024 10:28
@adamgall adamgall mentioned this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DAO Name doesn't update correctly
4 participants