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

bug: downvoting a repo in myVotes list does not remove it from ui #416

Open
2 tasks done
NsdHSO opened this issue Nov 30, 2022 · 13 comments
Open
2 tasks done

bug: downvoting a repo in myVotes list does not remove it from ui #416

NsdHSO opened this issue Nov 30, 2022 · 13 comments
Labels
🐛 bug Something isn't working

Comments

@NsdHSO
Copy link
Contributor

NsdHSO commented Nov 30, 2022

Describe the bug

If you are in MyVotes section and you press on the upvote/voted
list from My voted Repository

Steps to reproduce

  1. Go to the hot app
  2. MyVotes section
  3. Press upvote/voted
  4. look in My voted Repository it still remains behind

Affected services

hot.opensauced.pizza

Platforms

Desktop

Browsers

Chrome

Environment

Production

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs
@NsdHSO NsdHSO added the 🐛 bug Something isn't working label Nov 30, 2022
@0-vortex
Copy link
Contributor

Do you mean after up or down voting, the repository remains in the list of voted repos?
If so, you could adjust the title to something more relevant like "bug: downvoting a repo in myVotes list does not remove it from ui" 🍕

@NsdHSO NsdHSO changed the title Bug: make action on hot repos and list of my votes still without there action bug: downvoting a repo in myVotes list does not remove it from ui Nov 30, 2022
@NsdHSO
Copy link
Contributor Author

NsdHSO commented Nov 30, 2022

Do you mean after up or down voting, the repository remains in the list of voted repos? If so, you could adjust the title to something more relevant like "bug: downvoting a repo in myVotes list does not remove it from ui" 🍕

yes, this is the issue, Tnx for your help.

@0-vortex
Copy link
Contributor

@bdougie GFI?

@bdougie
Copy link
Member

bdougie commented Nov 30, 2022

@bdougie GFI?

Not quite. This still needs more info and an attempt at a suggested solution. My guess is that the votes hooks need to refetch the votes when the button is clicked.

@rajat4984
Copy link
Contributor

Is this issue resolved?

@Alexandre-Lustosa-Escossio

I'll try to .take this one

@github-actions
Copy link

Thanks for taking this on! If you have not already, join the conversation in our Discord

@Alexandre-Lustosa-Escossio
Copy link

Since I didn't have any pictures of the issue I tried going straight to the site and reproducing it. It turns out I'm not able to upvote any repository from any page. With further investigation, I found that the post call when I upvote/downvote a repo is returning 409 and apparently it's a problem in the database's schema so It might be nothing wrong with the code.
image
image
Could someone help me understand if I'm going in the right direction?

@takanome-dev
Copy link
Contributor

After you upvote or downvote a repo, the voted repos should be refetched and the UI updated.

But I think there is an issue in the API we need to address. See https://github.com/open-sauced/api/issues/122

Feel free to give it a try and let us know how it goes 🙂

@Alexandre-Lustosa-Escossio Alexandre-Lustosa-Escossio removed their assignment Jul 23, 2023
@Alexandre-Lustosa-Escossio

Hey guys, since my time is short and I can't tackle the backend issues that avoid me from solving this one I'll leave this one open for someone who has more free time!

@JDGuillaume
Copy link

JDGuillaume commented Jul 26, 2023

Updated post to reflect additional insight.

Would love to .take this one. New to open source, but I've worked with React previously.

Based on the traffic listed in the Network tab, it appears that the page is essentially DDoSing the provided Supabase endpoint. On the initial payload, I'm observing approximately 112 requests to the database. Without interacting with the page, the number of requests to Supabase are continuing to grow.

As @bdougie suggested, I think that the useEffect dependency in the useVotedRepos component may be to blame. It's triggering an infinite rerender or so it appears.

Screen Shot 2023-07-26 at 5 39 00 PM

@github-actions
Copy link

Thanks for taking this on! If you have not already, join the conversation in our Discord

@github-actions
Copy link

Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor. Please communicate with the assigned contributor to confirm the status of the issue.

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

No branches or pull requests

7 participants