Skip to content

fix(market): scope Pinto pod listings to marketplace "0"#423

Merged
fr1jo merged 2 commits intomainfrom
fix/pod-market-purchaseable-pods-undefined-marketplace
Apr 9, 2026
Merged

fix(market): scope Pinto pod listings to marketplace "0"#423
fr1jo merged 2 commits intomainfrom
fix/pod-market-purchaseable-pods-undefined-marketplace

Conversation

@fr1jo
Copy link
Copy Markdown
Contributor

@fr1jo fr1jo commented Apr 9, 2026

Summary

  • Bug: On the Pod Market "Buy Pods" tab, "Purchaseable Pods: 0" was shown even when pod listings were visible on the chart, making it impossible to buy pods on the Pinto marketplace.
  • Root cause: src/pages/Market.tsx:222 set podMarketplaceId = undefined for the Pinto tab. usePodListings/usePodOrders only apply the podMarketplace GraphQL filter when the value is truthy, so undefined caused them to return listings from both fields. Beanstalk-field listings (field 1) have indices in a different index space, so the place-in-line filter at FillListing.tsx:349 (listingIndex.lte(maxPlaceIndex), where maxPlaceIndex is built from Pinto's activeHarvestableIndex) rejected all of them → 0 purchaseable.
  • Fix: Default to "0" on the Pinto tab, matching the fieldId = isBeanstalkMarketplace ? 1n : 0n pattern on the line directly above and the ?? "0" fallback already used in useAllMarket.ts:25-26.

Technical details

One-line change in src/pages/Market.tsx:

- const podMarketplaceId = isBeanstalkMarketplace ? "1" : undefined;
+ const podMarketplaceId = isBeanstalkMarketplace ? "1" : "0";

The corrected value flows through BeanstalkMarketContext to all consumers:

  • FillListing (fixes the reported "Purchaseable Pods: 0" bug)
  • PodListingsTable, PodOrdersTable, FillOrder (same inconsistency, now consistent)

Side effect: The chart on the Pinto tab will no longer display Beanstalk-field listings. Those were never actually fillable from the Pinto tab anyway — fillPodListing is called with fieldId=0 on that tab, so any attempt to fill a Beanstalk listing would have reverted on-chain.

Test plan

  • Navigate to Pod Market → Buy Pods on Pinto marketplace
  • Confirm "Purchaseable Pods" count is > 0 when Pinto listings exist and sliders are set to reasonable values
  • Confirm chart only shows Pinto-field listings (no spurious Beanstalk listings)
  • Toggle to Beanstalk marketplace → confirm Beanstalk listings are shown and Buy Pods still works
  • Confirm PodListingsTable / PodOrdersTable only show listings/orders for the active marketplace

🤖 Generated with Claude Code

On the Pinto marketplace tab, podMarketplaceId was undefined, which
caused usePodListings/usePodOrders to skip the podMarketplace filter
entirely and return listings from both fields. Beanstalk-field
listings (field 1) have indices in a different index space, so the
place-in-line filter in FillListing rejected all of them, producing
"Purchaseable Pods: 0" even when Pinto listings existed.

Default to "0" to match the fieldId pattern on the line above and the
?? "0" fallback already used in useAllMarket.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for pintomoney ready!

Name Link
🔨 Latest commit b333115
🔍 Latest deploy log https://app.netlify.com/projects/pintomoney/deploys/69d813ca0fec9a0008e4d0b6
😎 Deploy Preview https://deploy-preview-423.preview.pinto.money
📱 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 project configuration.

The committed generated types in src/generated/gql/ had drifted from
the current subgraph schemas (deprecated *_nocase filter variants and
a few similar fields were removed upstream). CI's "Check codegen is up
to date" step was failing on this PR (and had been failing on every PR
since 2026-03-21). Running `yarn generate` to refresh.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@fr1jo fr1jo merged commit 0da2605 into main Apr 9, 2026
6 checks passed
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.

1 participant