Skip to content

Conversation

@ElasticBottle
Copy link
Contributor

@ElasticBottle ElasticBottle commented Dec 3, 2024

https://linear.app/thirdweb/issue/CNCT-2523/remapping-of-siwe-wallet-type-in-typescript-sdk


PR-Codex overview

This PR focuses on updating the getUser function in the Profiles to align with TypeScript types, enhancing error handling, and adding tests for various user query scenarios.

Detailed summary

  • Updated type in getUser to ensure it matches TypeScript types.
  • Modified the profiles mapping to correctly set the type based on conditions.
  • Added unit tests for getUser covering error cases and various query parameters (email, phone, id, externalWalletAddress).
  • Implemented error handling for fetch failures and user not found scenarios.

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

@linear
Copy link

linear bot commented Dec 3, 2024

@vercel
Copy link

vercel bot commented Dec 3, 2024

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 Dec 4, 2024 2:07am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 2:07am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 2:07am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 2:07am

@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2024

🦋 Changeset detected

Latest commit: 68ad62f

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

This PR includes changesets to release 1 package
Name Type
thirdweb 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

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 3, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 47.99 KB (+0.15% 🔺) 960 ms (+0.15% 🔺) 346 ms (+33.41% 🔺) 1.4 s
thirdweb (cjs) 107.51 KB (+0.12% 🔺) 2.2 s (+0.12% 🔺) 466 ms (+7.54% 🔺) 2.7 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 78 ms (+393.88% 🔺) 190 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 5 ms (+54.55% 🔺) 15 ms
thirdweb/react (minimal + tree-shaking) 18.29 KB (0%) 366 ms (0%) 102 ms (+118.56% 🔺) 468 ms

@codecov
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.29%. Comparing base (1a99ea3) to head (68ad62f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5593      +/-   ##
==========================================
+ Coverage   44.19%   44.29%   +0.10%     
==========================================
  Files        1082     1082              
  Lines       56253    56258       +5     
  Branches     3974     3990      +16     
==========================================
+ Hits        24862    24921      +59     
+ Misses      30708    30654      -54     
  Partials      683      683              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 1a99ea3
packages 39.17% <100.00%> (+0.12%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
.../thirdweb/src/wallets/in-app/core/users/getUser.ts 100.00% <100.00%> (+98.18%) ⬆️

@gregfromstl gregfromstl changed the title fix: type wallet doesn't exists in getUser [SDK] Fix: Type wallet doesn't exists in getUser Dec 3, 2024
@ElasticBottle ElasticBottle added the merge-queue Adds the pull request to Graphite's merge queue. label Dec 3, 2024
Copy link
Contributor Author

ElasticBottle commented Dec 3, 2024

Merge activity

  • Dec 3, 10:56 AM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 3, 8:51 PM EST: A user added this pull request to the Graphite merge queue.
  • Dec 3, 9:08 PM EST: A user merged this pull request with the Graphite merge queue.

ElasticBottle added a commit that referenced this pull request Dec 4, 2024
https://linear.app/thirdweb/issue/CNCT-2523/remapping-of-siwe-wallet-type-in-typescript-sdk

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the `getUser` function in the `Profiles` to align with TypeScript types and enhancing the test suite for `getUser` to cover various scenarios, including error handling and different query parameters.

### Detailed summary
- Updated `type` in `getUser` to ensure it matches TypeScript types.
- Enhanced `profiles` mapping to correctly categorize profile types.
- Added tests for error scenarios when no secret key or query parameter is provided.
- Implemented tests for fetching user data by email, phone, ID, and external wallet address.
- Added handling for fetch errors and cases where no user is found.

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

<!-- end pr-codex -->
@ElasticBottle ElasticBottle force-pushed the winston/cnct-2523-remapping-of-siwe-wallet-type-in-typescript-sdk branch from a6d9c14 to 8c0607c Compare December 4, 2024 01:52
https://linear.app/thirdweb/issue/CNCT-2523/remapping-of-siwe-wallet-type-in-typescript-sdk

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the `getUser` function in the `Profiles` to align with TypeScript types and enhancing its test coverage.

### Detailed summary
- Updated the `type` in `getUser` to correctly classify profile types as either "wallet" or their original type.
- Added unit tests to handle various scenarios: missing secret key, missing query parameters, and handling fetch errors.
- Verified correct API URL calls for different query parameters (email, phone, id, externalWalletAddress).
- Included tests for fetching user profiles and handling cases where no user is found.

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

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants