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

feat: Use sidekick server to handle CSV report download #3835

Merged
merged 13 commits into from
Jun 16, 2023

Conversation

wa0x6e
Copy link
Collaborator

@wa0x6e wa0x6e commented Apr 27, 2023

Issues

Fixes #3756

Use https://github.com/snapshot-labs/snapshot-sidekick to handle the votes CSV report download

Changes

  1. Refactor the useReportDownload composable to download the complete file from sidekick server, instead of building it from snapshot-hub requests.
  2. Show error message in case of download errors

How to test

  1. Go to a closed proposal
  2. Try to download the votes CSV report
  • It should download the CSV file if the file is cached on sidekick
  • It should show a modal with a pending generation error message if the file is not ready yet on sidekick
  • It should show a modal with a generic error message on all other errors (sidekick not online)

To-Do

  • Waiting for sidekick server to be online/deployed

Self-review checklist

  • I have performed a full self-review of my changes
  • I have tested my changes on a preview deployment
  • I have tested my changes on a custom domain
  • I have run end-to-end tests yarn cypress:test:e2e, and they have passed

This PR is ready, waiting to backend server to be online before merging

@vercel
Copy link

vercel bot commented Apr 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
snapshot ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2023 6:51am

@wa0x6e wa0x6e self-assigned this Apr 27, 2023
@samuveth
Copy link
Contributor

samuveth commented May 5, 2023

Now that snapshot-labs/snapshot-sidekick#1 was merged can we move forward with getting this ready?

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented May 5, 2023

I think this PR is pretty much done, the download button now return an error as expected, since sidekick is offline. Need to wait for the server deployment to start testing with real files

@samuveth samuveth added enhancement New feature or request and removed enhancement New feature or request labels May 8, 2023
@samuveth
Copy link
Contributor

We should be able to deploy this now on the new DO account @bonustrack created for you

@wa0x6e wa0x6e marked this pull request as ready for review May 13, 2023 21:38
@wa0x6e
Copy link
Collaborator Author

wa0x6e commented May 13, 2023

Since the server is empty, all download requests will end up with a "retry later" error, until cache is warmed up.

Should we pre-warm all the biggest and recent proposals first ?

@samuveth
Copy link
Contributor

@wa0x6e you mean this error?
image

I think this is totally fine and we don't need to pre-warm any proposals.

@samuveth
Copy link
Contributor

samuveth commented May 14, 2023

What happens if the user clicks download again while cache is ongoing? Will it interrupt anything on sidekick?

@samuveth
Copy link
Contributor

I've been waiting a while and I still the error above when trying to download the votes here https://snapshot-nay16zdzi-snapshot.vercel.app/#/stgdao.eth/proposal/0x6b703b90d3cd1f82f7c176fc2e566a2bb79e8eb6618a568b52a4f29cb2f8d57b

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented May 14, 2023

I've been waiting a while and I still the error above when trying to download the votes here https://snapshot-nay16zdzi-snapshot.vercel.app/#/stgdao.eth/proposal/0x6b703b90d3cd1f82f7c176fc2e566a2bb79e8eb6618a568b52a4f29cb2f8d57b

Just tried, it works. Generation may takes time, depending on number of votes. Count ~2s per 1000 votes

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented May 14, 2023

What happens if the user clicks download again while cache is ongoing? Will it interrupt anything on sidekick?

No, duplicate are ignored

@samuveth
Copy link
Contributor

https://snapshot-nay16zdzi-snapshot.vercel.app/#/stgdao.eth/proposal/0xb89734985fddc3bc70404eaa6d62100ddeeea26c54c0ea55f66a089f79dde3ca

I tried again here, it should take around 3 minutes but it's been taking longer than 10

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented May 14, 2023

Issue appears to come from the hub, rate limiting all the requests

@samuveth
Copy link
Contributor

samuveth commented May 15, 2023

Please request another review once you've solved the rate limiting

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented May 15, 2023

Please request another review once you've solved the rate limiting

Rate limit will be solved by implementing the new API keys. For now, we just wait

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented May 26, 2023

@samuveth Throttling issue has been resolved on sidekick. Can you try again ?

@samuveth
Copy link
Contributor

https://snapshot-lwxw3n2hm-snapshot.vercel.app/#/stgdao.eth/proposal/0x6b703b90d3cd1f82f7c176fc2e566a2bb79e8eb6618a568b52a4f29cb2f8d57b

The count on the proposals page does not match the line count in the CSV file:
image
image

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented May 28, 2023

https://snapshot-lwxw3n2hm-snapshot.vercel.app/#/stgdao.eth/proposal/0x6b703b90d3cd1f82f7c176fc2e566a2bb79e8eb6618a568b52a4f29cb2f8d57b
The count on the proposals page does not match the line count in the CSV file:

Should be fixed via snapshot-labs/snapshot-sidekick#47

@samuveth
Copy link
Contributor

samuveth commented May 30, 2023

Should be fixed via snapshot-labs/snapshot-sidekick#47

I assume it will only be fixed for proposals where the votes haven't been cached yet, because I still see the same count issue on the proposal above.

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented Jun 4, 2023

I assume it will only be fixed for proposals where the votes haven't been cached yet, because I still see the same count issue on the proposal above.

Cache has been cleared. Should serve the correct version now

@wa0x6e
Copy link
Collaborator Author

wa0x6e commented Jun 7, 2023

Modal message UI has been updated

Copy link
Contributor

@samuveth samuveth left a comment

Choose a reason for hiding this comment

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

tACK

@samuveth
Copy link
Contributor

Can you fix the conflicts?

@samuveth samuveth merged commit 4e8b02a into develop Jun 16, 2023
@samuveth samuveth deleted the add-sidekick-votes-download branch June 16, 2023 05:51
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.

[NEW FEATURE] - Cache server for votes download
2 participants