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: duplicate items in itemsGrid #6855

Merged
merged 9 commits into from
Aug 25, 2023
Merged

Conversation

stephenjason89
Copy link
Contributor

@stephenjason89 stephenjason89 commented Aug 21, 2023

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Issue was caused by
image

together with
image

Upon navigating to explore items, the query runs already to fetch page 1 but at the same time, breadCrumbsFilter onMounted event sets listed=true

Thus making the watcher to run the query again for page 1 which causes the duplicates.

The fix was to have a separate watcher for listed and only run if listed was already set by BreadCrumbsFilter.
This will avoid the re-querying of data which causes the duplicates.

Before submitting pull request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality

Optional

  • I've tested it at </ksm/collection>
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

Did your issue had any of the "$" label on it?

  • Fill up your DOT address: Payout

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

Copilot Summary

🤖 Generated by Copilot at 769abca

Refactored the code for opening the shopping cart modal from the navbar. Moved the logic and configuration from ShoppingCartModalConfig.ts and ShoppingCartButton.vue to Navbar.vue to improve code organization and performance.

🤖 Generated by Copilot at 769abca

ShoppingCartButton
Simpler, no more emit -
Autumn leaves falling

@stephenjason89 stephenjason89 requested a review from a team as a code owner August 21, 2023 14:03
@stephenjason89 stephenjason89 requested review from preschian and Jarsen136 and removed request for a team August 21, 2023 14:03
@kodabot
Copy link
Collaborator

kodabot commented Aug 21, 2023

WARNING @stephenjason89 PR for issue #6677 which isn't assigned to you. Please be warned that this PR may get rejected if there's another assignee for issue #6677

@netlify
Copy link

netlify bot commented Aug 21, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 59e2ae0
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64e74b2472b1720008d015e9
😎 Deploy Preview https://deploy-preview-6855--koda-canary.netlify.app
📱 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.

@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 21, 2023

AI-Generated Summary: This pull request includes a patch for the useFetchSearch function in the ItemsGrid component. The change includes the removal of route.query.listed from one of the dependency arrays triggering the function. Additionally, a watch function has been added to observe changes to route.query.listed, which will now call resetSearch if it has an old value. The purpose of these changes is to provide a temporary fix to an unspecified issue.

@yangwao
Copy link
Member

yangwao commented Aug 21, 2023

will plan to do release shortly if someone check this one, seems quite important for production 👀

@vikiival
Copy link
Member

will plan to do release shortly if someone check this one, seems quite important for production 👀

cc @Jarsen136, @prury thanks ❤️

@Jarsen136
Copy link
Contributor

The bug is still there after testing.

https://deploy-preview-6855--koda-canary.netlify.app/ksm/explore/items

Kapture 2023-08-21 at 22 35 35

@prury prury added the S-changes-requested-🤞 PR is almost good to go, just some fine tunning label Aug 21, 2023
@stephenjason89
Copy link
Contributor Author

@Jarsen136, I'm sorry there was a typo.
I mistakenly included an array on the watch.

Everything is working perfectly now.

Please check @Jarsen136

Copy link
Contributor

@Jarsen136 Jarsen136 left a comment

Choose a reason for hiding this comment

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

There is a bad case for this solutioin.

If you visit this collection page and then turn on 'buy now', it would not work any more.
https://deploy-preview-6855--koda-canary.netlify.app/ksm/collection/eecde2ad072011334d-DOTPEPE

@Jarsen136
Copy link
Contributor

Jarsen136 commented Aug 21, 2023

I have found a solution that could solve this issue. I will open a PR later. #6860

@stephenjason89
Copy link
Contributor Author

stephenjason89 commented Aug 21, 2023

@Jarsen136 please check #6730 (comment)

It was already discussed. This is the perfect example of the 1st scenario.

I thought despite the setbacks of this implementation will make this as a quick fix.

@Jarsen136
Copy link
Contributor

@Jarsen136 please check #6730 (comment)

It was already discussed.

I thought despite the setbacks of this implementation will make this as a quick fix.

I'm ok with a quick fix to be merged. However, I would choose a better solution if it introduces a new bug.

@stephenjason89
Copy link
Contributor Author

stephenjason89 commented Aug 21, 2023

I completely agree. Though, it would have been really nice if you could have pointed me in the right direction for the fix as I've been debugging to find the bug and discussing potential solutions on the matter. Instead of opening a new PR.

Anyway, thank you and i appreciate your efforts on checking the PR

@stephenjason89
Copy link
Contributor Author

stephenjason89 commented Aug 21, 2023

@Jarsen136 I have left a comment on your PR #6860
It was not an ideal fix.

Please check if everything is working here now. I have revised the implementation and taken inspiration from your PR.

Thank you

@Jarsen136
Copy link
Contributor

@Jarsen136 I have left a comment on your PR #6860 It was not an ideal fix.

Please check if everything is working here now. I have revised the implementation and taken inspiration from your PR.

Thank you

I'm glad to see you continue to improve your commit. I patiently waited for you to provide a suitable fix until I repeatedly reviewed the code and found that the bug still happens. This bug fix should not take around one week. I'm sorry that I'm not going to review this PR.

@stephenjason89
Copy link
Contributor Author

@Jarsen136, I apologize for any inconvenience this might have caused. I've been actively following up on the PR, but unfortunately, I received no assistance for a week. The issue was awaiting review, and my comments went unanswered. I was waiting with patience, so the delay wasn't from my side. I hope you can appreciate that.

The conversation progressed when @yangwao tagged @vikiival.

I completely understand that everyone has commitments, and I don't wish to chase trivial matters. My questions were genuine, and without clearer guidance on your expectations for the solution, I'm working somewhat in the dark.

Maybe @prury can assist in reviewing this PR? It's a valid fix and addresses the current problem.

@stephenjason89 stephenjason89 changed the title fix: duplicate items in itemsGrid fix: duplicate items in itemsGrid & #6865 Aug 22, 2023
@stephenjason89 stephenjason89 changed the title fix: duplicate items in itemsGrid & #6865 fix: duplicate items in itemsGrid & buy now filter not working in explorer Aug 22, 2023
@stephenjason89
Copy link
Contributor Author

Hello @JustLuuuu, included a fix for your issue #6865 here.

Thank you for reporting it.

@Jarsen136
Copy link
Contributor

Hello @JustLuuuu, included a fix for your issue #6865 here.

Thank you for reporting it.

Hey, @stephenjason89, it's another bug that comes from some recent merging. I merged the main branch into it so that you could reproduce it.

@stephenjason89
Copy link
Contributor Author

stephenjason89 commented Aug 22, 2023

Hello @JustLuuuu, included a fix for your issue #6865 here.
Thank you for reporting it.

Hey, @stephenjason89, it's another bug that comes from some recent merging. I merged the main branch into it so that you could reproduce it.

Thank you so much. I managed to fix the issue.
I just refactored a little bit as well.
Here's the PR for it #6868

@stephenjason89 stephenjason89 changed the title fix: duplicate items in itemsGrid & buy now filter not working in explorer fix: duplicate items in itemsGrid Aug 22, 2023
@prury prury added the S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked label Aug 23, 2023
@codeclimate
Copy link

codeclimate bot commented Aug 24, 2023

Code Climate has analyzed commit 59e2ae0 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Aug 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@stephenjason89 stephenjason89 removed the S-changes-requested-🤞 PR is almost good to go, just some fine tunning label Aug 24, 2023
@stephenjason89
Copy link
Contributor Author

Hello @Jarsen136 & @preschian,
I believe this branch is good to go. If you could kindly check it.
Blocker #6868 has been merged already.

Thank you

Copy link
Contributor

@Jarsen136 Jarsen136 left a comment

Choose a reason for hiding this comment

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

Let's go, as it's been stuck for too long.

@yangwao
Copy link
Member

yangwao commented Aug 25, 2023

pay 30 usd

@yangwao yangwao merged commit f616c81 into kodadot:main Aug 25, 2023
14 checks passed
@yangwao
Copy link
Member

yangwao commented Aug 25, 2023

😍 Perfect, I’ve sent the payout
💵 $30 @ 4.47 USD/DOT ~ 6.711 $DOT
🧗 16UcV9V6nVvPYdHz98ymUKmNLkzjCEU5sbKJMi7hxYyTHjzR
🔗 0x47937d6cbe63c6a931dfe729207e8c9326573a089f0ae17ff7b9f6b17dfb8b98

🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues

@yangwao yangwao added the paid pull-request has been paid label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paid pull-request has been paid S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Same item twice in explore feed
6 participants