Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Apr 2, 2025

Fixes TOOL-3924


PR-Codex overview

This PR focuses on fixing the handling of date timestamps in the updateListing function within the thirdweb package, ensuring correct validation and assignment of start and end timestamps.

Detailed summary

  • Updated startTimestamp and endTimestamp assignment logic in updateListing.ts to handle cases with mergedOptions.
  • Added validation to ensure startTimestamp is before endTimestamp.
  • Introduced a test case for updateListing in direct-listings.test.ts.
  • Adjusted expected values for secondListing in the test to reflect the new price.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@vercel
Copy link

vercel bot commented Apr 2, 2025

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2025 10:40pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2025 10:40pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2025 10:40pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2025 10:40pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2025 10:40pm

@changeset-bot
Copy link

changeset-bot bot commented Apr 2, 2025

🦋 Changeset detected

Latest commit: 22dc69a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the SDK Involves changes to the thirdweb SDK label Apr 2, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@joaquim-verges joaquim-verges changed the title Fix updateListing date handling in marketplace direct listings [SDK] Fix updateListing date handling in marketplace direct listings Apr 2, 2025
@linear
Copy link

linear bot commented Apr 2, 2025

@joaquim-verges joaquim-verges marked this pull request as ready for review April 2, 2025 22:18
@joaquim-verges joaquim-verges requested review from a team as code owners April 2, 2025 22:18
@joaquim-verges joaquim-verges force-pushed the Fix_updateListing_date_handling_in_marketplace_direct_listings branch from ba79d2d to 722da03 Compare April 2, 2025 22:18
@joaquim-verges joaquim-verges force-pushed the Fix_updateListing_date_handling_in_marketplace_direct_listings branch from 722da03 to 21f51ba Compare April 2, 2025 22:20
@github-actions
Copy link
Contributor

github-actions bot commented Apr 2, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47.49 KB (0%) 950 ms (0%) 1.7 s (+7.5% 🔺) 2.6 s
thirdweb (cjs) 129.89 KB (0%) 2.6 s (0%) 4.4 s (+6.22% 🔺) 7 s
thirdweb (minimal + tree-shaking) 5.62 KB (0%) 113 ms (0%) 225 ms (+105.01% 🔺) 337 ms
thirdweb/chains (tree-shaking) 514 B (0%) 11 ms (0%) 37 ms (-2.4% 🔽) 47 ms
thirdweb/react (minimal + tree-shaking) 19.33 KB (0%) 387 ms (0%) 549 ms (+80.23% 🔺) 936 ms

@codecov
Copy link

codecov bot commented Apr 2, 2025

Codecov Report

Attention: Patch coverage is 28.57143% with 10 lines in your changes missing coverage. Please review.

Project coverage is 54.97%. Comparing base (5faaf1b) to head (22dc69a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...marketplace/direct-listings/write/updateListing.ts 28.57% 10 Missing ⚠️

❌ Your patch status has failed because the patch coverage (28.57%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6628      +/-   ##
==========================================
+ Coverage   54.96%   54.97%   +0.01%     
==========================================
  Files         887      888       +1     
  Lines       55652    55752     +100     
  Branches     3798     3817      +19     
==========================================
+ Hits        30591    30652      +61     
- Misses      24966    25005      +39     
  Partials       95       95              
Flag Coverage Δ
packages 54.97% <28.57%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
...marketplace/direct-listings/write/updateListing.ts 61.00% <28.57%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joaquim-verges joaquim-verges force-pushed the Fix_updateListing_date_handling_in_marketplace_direct_listings branch from 21f51ba to 22dc69a Compare April 2, 2025 22:29

if (
startTimestamp !== mergedOptions.startTimeInSeconds &&
startTimestamp <= lastestBlock.timestamp
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be a typo in the variable name lastestBlock which should be latestBlock. This typo occurs in multiple places throughout the conditional checks in the date validation logic.

Suggested change
startTimestamp <= lastestBlock.timestamp
startTimestamp <= latestBlock.timestamp

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@joaquim-verges joaquim-verges deleted the Fix_updateListing_date_handling_in_marketplace_direct_listings branch April 2, 2025 23:27
@joaquim-verges joaquim-verges mentioned this pull request Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants