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: quick buy infinite loading #9484

Closed
wants to merge 4 commits into from

Conversation

pbkompasz
Copy link
Contributor

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

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

@kodabot
Copy link
Collaborator

kodabot commented Feb 19, 2024

SUCCESS @pbkompasz PR for issue #9477 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime!

Copy link

netlify bot commented Feb 19, 2024

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 51c3d2a
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/65d4d48d886bce00086e4651
😎 Deploy Preview https://deploy-preview-9484--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.

@pbkompasz
Copy link
Contributor Author

Test is failing due to Commands.e2elogin()

@@ -5,6 +5,7 @@
scroll="clip"
class="z-[1000]"
content-class="modal-width"
data-testid="confirm-modal"
Copy link
Member

Choose a reason for hiding this comment

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

for some reason i could not find this data-testid on the generated page

await page.goto(ITEMS_PATH)

await test.step('Buy now from explorer', async () => {
await page.getByTestId('item-buy').first().click()
Copy link
Member

Choose a reason for hiding this comment

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

you have to hover over the first card for the buy now button to appear


await test.step('Buy now from explorer', async () => {
await page.getByTestId('item-buy').first().click()
await expect(await page.getByTestId('confirm-modal')).toBeVisible()
Copy link
Member

Choose a reason for hiding this comment

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

we may have to add timeout, since its not always fast

@prury
Copy link
Member

prury commented Feb 19, 2024

Test is failing due to Commands.e2elogin()

nope, its actually the test itself, lacking some lines, appreciate it tho

regarding solution, buy now no longer on infinite loading ✔️

@prury prury added the S-changes-requested-🤞 PR is almost good to go, just some fine tunning label Feb 19, 2024
@hassnian
Copy link
Contributor

hassnian commented Feb 20, 2024

@pbkompasz this section

CleanShot 2024-02-20 at 09 01 15@2x

it's working at it should, so no changes needed there

the issue is that , it's failing to connect to the websocket when trying to subscribe for price changes ,

@kodadot/internal-dev can you guys check that ? wss://ahp.gql.api.kodadot.xyz/

CleanShot 2024-02-20 at 08 59 34@2x

handle the onError case inside subscribeToNftPriceChange's graphql subscription.

thanks

@vikiival
Copy link
Member

Cc @preschian

@preschian
Copy link
Member

the issue is that , it's failing to connect to the websocket when trying to subscribe for price changes ,

@kodadot/internal-dev can you guys check that ? wss://ahp.gql.api.kodadot.xyz/

oooh, this one, when trying to target subscriptions, should use old endpoints. @hassnian @pbkompasz could you check if this file is working or not https://github.com/kodadot/nft-gallery/blob/main/utils/websocket.ts#L4-L8

recently I changed that files

@preschian
Copy link
Member

checking~

@preschian
Copy link
Member

preschian commented Feb 20, 2024

@hassnian @pbkompasz Sorry there was a typo, fixed here: #9491

@hassnian @vikiival , thanks for the mentioning

@preschian preschian mentioned this pull request Feb 20, 2024
6 tasks
Copy link

sonarcloud bot commented Feb 20, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

codeclimate bot commented Feb 20, 2024

Code Climate has analyzed commit 51c3d2a and detected 0 issues on this pull request.

View more on Code Climate.

Comment on lines -107 to +115
const loading = computed(() => !autoteleport.value?.isReady || props.loading)
const loading = ref(props.loading)

watch(
() => autoteleport.value?.isReady,
(val) => {
loading.value = !val
},
)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about

Suggested change
const loading = computed(() => !autoteleport.value?.isReady || props.loading)
const loading = ref(props.loading)
watch(
() => autoteleport.value?.isReady,
(val) => {
loading.value = !val
},
)
const loading = computed(() => autoteleport.value?.isReady ? !autoteleport.value.isReady : props.loading)

Comment on lines +108 to +115
const loading = ref(props.loading)

watch(
() => autoteleport.value?.isReady,
(val) => {
loading.value = !val
},
)
Copy link
Contributor

@hassnian hassnian Feb 21, 2024

Choose a reason for hiding this comment

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

@daiagi no changes needed here

this is the initial code

CleanShot 2024-02-21 at 14 57 27@2x

the issue #9477 that this pr fixes got already fixed by #9491

#9484 (comment)

if anything, we can handle the error case inside the subscription

CleanShot 2024-02-21 at 14 55 35@2x

and set hasSyncedPrices to true , which is used the show the loading

CleanShot 2024-02-21 at 15 00 14@2x

@prury
Copy link
Member

prury commented Feb 21, 2024

@hassnian close this one then?

@hassnian
Copy link
Contributor

@hassnian close this one then?

Sure, since it's already working

If anything as I said the only thing would be to handle the case where the websocket connection fails

@prury prury closed this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-changes-requested-🤞 PR is almost good to go, just some fine tunning waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

quick buy not loading
8 participants