-
Notifications
You must be signed in to change notification settings - Fork 545
[SDK] Add account deletion support when unlinking profiles #7211
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
[SDK] Add account deletion support when unlinking profiles #7211
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 6fc8afd The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
## Walkthrough
The changes introduce support for account deletion when unlinking profiles in the thirdweb SDK. An optional `allowAccountDeletion` parameter is added to relevant functions and hooks, enabling deletion of the entire account if the last profile is unlinked. Function signatures, interfaces, and documentation are updated accordingly.
## Changes
| File(s) | Change Summary |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| .changeset/account-deletion-unlink.md | Documents the addition of account deletion support during profile unlinking, with usage examples. |
| packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts<br>packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts | Enhanced `useUnlinkProfile` hook to accept optional `allowAccountDeletion` parameter and updated documentation. |
| packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts | Updated `unlinkAccount` to accept and forward optional `allowAccountDeletion` parameter in API requests. |
| packages/thirdweb/src/wallets/in-app/core/authentication/types.ts | Added optional `allowAccountDeletion` property to `UnlinkParams` type. |
| packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts | Updated `InAppConnector` interface's `unlinkProfile` method to accept optional `allowAccountDeletion` parameter. |
| packages/thirdweb/src/wallets/in-app/native/auth/index.ts | Modified internal call to connector's `unlinkProfile` to include `allowAccountDeletion`. |
| packages/thirdweb/src/wallets/in-app/native/native-connector.ts<br>packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts | Updated `unlinkProfile` method signatures to accept and forward optional `allowAccountDeletion` parameter. |
| packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts | Updated function to pass `allowAccountDeletion` to connector and extended documentation with usage examples. |
| packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.test.ts | Updated test to expect request body with `type`, `details`, and `allowAccountDeletion` instead of full profile object. |
| packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.test.tsx | Added tests verifying `allowAccountDeletion` parameter handling in `useUnlinkProfile` hook mutation calls. |
| packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.test.tsx | Updated tests to include `allowAccountDeletion: false` in expected calls to `unlinkProfile`. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant ReactHook
participant SDKFunction
participant Connector
participant API
User->>ReactHook: useUnlinkProfile({ allowAccountDeletion })
ReactHook->>SDKFunction: unlinkProfile({ profileToUnlink, allowAccountDeletion })
SDKFunction->>Connector: unlinkProfile(profileToUnlink, allowAccountDeletion)
Connector->>API: POST /account/disconnect { type, details, allowAccountDeletion }
API-->>Connector: Response (profiles or account deleted)
Connector-->>SDKFunction: Result
SDKFunction-->>ReactHook: Result
ReactHook-->>User: Success/Error Assessment against linked issues
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts (1)
86-86
: Remove debug logging before production deployment.The console.log statement appears to be for debugging purposes and should be removed before merging to production to avoid unnecessary logging in the client application.
- console.log("allowAccountDeletion", allowAccountDeletion);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
.changeset/account-deletion-unlink.md
(1 hunks)packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts
(3 hunks)packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/types.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/native/auth/index.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/native/native-connector.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (6)
packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts (2)
packages/thirdweb/src/wallets/in-app/core/authentication/types.ts (1)
Profile
(119-127)packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts (1)
unlinkAccount
(65-113)
packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts (1)
packages/thirdweb/src/wallets/in-app/core/authentication/types.ts (1)
Profile
(119-127)
packages/thirdweb/src/wallets/in-app/native/native-connector.ts (1)
packages/thirdweb/src/wallets/in-app/core/authentication/types.ts (1)
Profile
(119-127)
packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts (2)
packages/thirdweb/src/exports/thirdweb.ts (1)
ThirdwebClient
(26-26)packages/thirdweb/src/wallets/in-app/core/authentication/types.ts (1)
Profile
(119-127)
packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts (4)
packages/thirdweb/src/wallets/in-app/native/auth/index.ts (1)
unlinkProfile
(204-210)packages/thirdweb/src/wallets/in-app/native/native-connector.ts (1)
unlinkProfile
(370-381)packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts (1)
unlinkProfile
(473-481)packages/thirdweb/src/wallets/in-app/core/authentication/types.ts (1)
UnlinkParams
(258-263)
packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts (1)
packages/thirdweb/src/wallets/in-app/core/authentication/types.ts (1)
Profile
(119-127)
🪛 markdownlint-cli2 (0.17.2)
.changeset/account-deletion-unlink.md
5-5: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: Build Packages
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: Analyze (javascript)
🔇 Additional comments (15)
packages/thirdweb/src/wallets/in-app/core/authentication/types.ts (1)
262-262
: LGTM: Optional parameter added correctly.The addition of the optional
allowAccountDeletion
boolean property toUnlinkParams
is well-implemented and maintains backward compatibility.packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts (1)
473-481
: LGTM: Parameter correctly added and passed through.The
unlinkProfile
method signature is properly updated with the optionalallowAccountDeletion
parameter, and it's correctly passed through to the underlyingunlinkAccount
function call. The implementation maintains backward compatibility and aligns with the interface definition.packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts (1)
40-43
: LGTM: Interface updated correctly.The
unlinkProfile
method signature in the interface is properly updated to include the optionalallowAccountDeletion
parameter. This correctly defines the contract that both web and native connector implementations follow.packages/thirdweb/src/wallets/in-app/native/native-connector.ts (1)
370-381
: LGTM: Consistent implementation across platforms.The
unlinkProfile
method in the native connector is correctly updated with the optionalallowAccountDeletion
parameter and properly passes it through to theunlinkAccount
function. This implementation maintains consistency with the web connector and follows the interface contract..changeset/account-deletion-unlink.md (1)
1-36
: LGTM! Comprehensive changeset documentation.The changeset provides excellent documentation with clear examples for both React hook and direct function usage. The examples properly demonstrate the new
allowAccountDeletion
parameter functionality.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
5-5: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
packages/thirdweb/src/wallets/in-app/native/auth/index.ts (1)
204-210
: LGTM! Correct parameter forwarding.The implementation properly forwards the
allowAccountDeletion
parameter from theUnlinkParams
to the connector'sunlinkProfile
method, maintaining consistency with the type definitions and preserving backward compatibility.packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts (2)
227-270
: Excellent documentation enhancement!The expanded documentation with three comprehensive examples (basic unlinking, ecosystem unlinking, and account deletion) provides clear guidance for different use cases. The examples are well-structured and demonstrate proper usage of the new
allowAccountDeletion
parameter.
273-279
: LGTM! Consistent implementation across platforms.The implementation correctly forwards the
allowAccountDeletion
parameter to the connector, maintaining consistency with the native implementation and ensuring unified behavior across web and native platforms.packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts (2)
34-50
: Great documentation addition!The new example clearly demonstrates how to use the
allowAccountDeletion
parameter with appropriate warning comments about its destructive nature. This helps developers understand the implications of enabling account deletion.
57-79
: LGTM! Safe implementation with proper defaults.The implementation correctly:
- Defaults
allowAccountDeletion
tofalse
for safety and backward compatibility- Uses proper TypeScript typing with optional boolean parameter
- Forwards the parameter to the underlying
unlinkProfile
functionThe safe default prevents accidental account deletion while maintaining backward compatibility.
packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts (3)
34-50
: Excellent documentation with clear example.The new documentation example clearly demonstrates how to use the
allowAccountDeletion
parameter and explains its purpose. This will help developers understand when and how to use this feature.
60-65
: Well-implemented parameter addition with backward compatibility.The
allowAccountDeletion
parameter is properly typed as optional with a sensible default value offalse
, ensuring backward compatibility while enabling the new functionality.
78-78
: Parameter correctly passed through to underlying function.The
allowAccountDeletion
parameter is properly forwarded to theunlinkProfile
function, ensuring the feature works throughout the call chain.packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts (2)
69-69
: Consistent parameter implementation maintains backward compatibility.The
allowAccountDeletion
parameter is properly implemented with an optional type and sensible default, maintaining consistency with the React hook implementation.Also applies to: 75-75
97-101
: Improved request body structure with explicit parameter inclusion.The modification to explicitly include
type
,details
, andallowAccountDeletion
in the request body is clearer and ensures the new parameter is properly sent to the API endpoint.
d82ddc4
to
b579835
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/account-deletion-unlink.md (1)
5-5
: Use a Markdown heading for the title
To satisfy markdownlint and improve readability, consider converting the title emphasis into a proper heading.- **Add account deletion support when unlinking profiles** + ### Add account deletion support when unlinking profiles🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
5-5: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
.changeset/account-deletion-unlink.md
(1 hunks)packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts
(3 hunks)packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/types.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/native/auth/index.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/native/native-connector.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
- packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts
- packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts
- packages/thirdweb/src/wallets/in-app/native/native-connector.ts
- packages/thirdweb/src/wallets/in-app/native/auth/index.ts
- packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts
- packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts
- packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts
- packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts
- packages/thirdweb/src/wallets/in-app/core/authentication/types.ts
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
.changeset/account-deletion-unlink.md
5-5: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Lint Packages
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
.changeset/account-deletion-unlink.md (3)
1-3
: Frontmatter format is valid
The changeset uses the correct patch bump and valid YAML frontmatter.
9-23
: React Hook usage example is clear
TheuseUnlinkProfile
snippet correctly demonstrates how to passallowAccountDeletion
when unlinking.
25-35
: Direct function example looks good
The standaloneunlinkProfile
example accurately reflects the updated signature.
size-limit report 📦
|
b579835
to
456fd10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.test.ts (1)
78-101
: 🛠️ Refactor suggestionAdd test coverage for
allowAccountDeletion: true
.The current test only covers the default behavior where
allowAccountDeletion
isfalse
. Consider adding a test case to verify the behavior whenallowAccountDeletion
is explicitly set totrue
.+ it("should successfully unlink an account with account deletion allowed", async () => { + const result = await unlinkAccount({ + client: mockClient, + profileToUnlink, + storage: mockStorage, + allowAccountDeletion: true, + }); + + expect(mockFetch).toHaveBeenCalledWith( + "https://embedded-wallet.thirdweb.com/api/2024-05-05/account/disconnect", + { + method: "POST", + headers: { + Authorization: "Bearer iaw-auth-token:mock-token", + "Content-Type": "application/json", + }, + body: JSON.stringify({ + type: profileToUnlink.type, + details: profileToUnlink.details, + allowAccountDeletion: true, + }), + }, + ); + expect(result).toEqual(mockLinkedAccounts); + });
🧹 Nitpick comments (2)
.changeset/account-deletion-unlink.md (2)
5-5
: Use a heading instead of bold text for the summary: MarkdownLint flagged MD036 (Emphasis used instead of a heading
). Replace the summary line with a markdown heading (e.g.,# Add account deletion support when unlinking profiles
).🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
5-5: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
25-35
: Document return value when account is deleted: The direct function example is accurate, but it’s unclear whatunlinkProfile
returns if the account is fully deleted (e.g., empty array,null
, or throws). Consider adding a note or sample code illustrating that edge case.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
.changeset/account-deletion-unlink.md
(1 hunks)packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts
(3 hunks)packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.test.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/types.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/native/auth/index.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/native/native-connector.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
- packages/thirdweb/src/wallets/in-app/core/authentication/types.ts
- packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts
- packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts
- packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts
- packages/thirdweb/src/wallets/in-app/native/auth/index.ts
- packages/thirdweb/src/wallets/in-app/native/native-connector.ts
- packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts
- packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts
- packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
.changeset/account-deletion-unlink.md
5-5: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: Build Packages
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.test.ts (1)
93-97
: Good update to match the new API contract.The test correctly verifies that the
unlinkAccount
function now sendsallowAccountDeletion: false
by default in the request body, which aligns with the new implementation..changeset/account-deletion-unlink.md (2)
1-3
: Frontmatter correctness: The YAML frontmatter is valid and correctly specifies thethirdweb
package bump topatch
.
9-23
: Clarify default behavior in React Hook example: The TSX snippet and import path look correct. Please verify thatallowAccountDeletion
indeed defaults tofalse
when omitted, and consider adding a note to the example or descriptive text to that effect.
456fd10
to
6fc8afd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.test.tsx (1)
15-77
: 🛠️ Refactor suggestionAdd test coverage for
allowAccountDeletion: true
scenario.The web version test suite is missing a test case to verify the behavior when
allowAccountDeletion
is explicitly set totrue
. The native version includes this test case (lines 50-73), but the web version doesn't have equivalent coverage.Consider adding a test similar to the one in the native version:
+ it("should call unlinkProfile with allowAccountDeletion if true", async () => { + vi.mocked(useConnectedWallets).mockReturnValue([]); + + const { result } = renderHook(() => useUnlinkProfile(), { + wrapper, + }); + const mutationFn = result.current.mutateAsync; + + await act(async () => { + await mutationFn({ + client: TEST_CLIENT, + profileToUnlink: mockProfile, + allowAccountDeletion: true, + }); + }); + + expect(unlinkProfile).toHaveBeenCalledWith({ + client: TEST_CLIENT, + ecosystem: undefined, + profileToUnlink: mockProfile, + allowAccountDeletion: true, + }); + expect(queryClient.invalidateQueries).toHaveBeenCalledWith({ + queryKey: ["profiles"], + }); + });
🧹 Nitpick comments (2)
.changeset/account-deletion-unlink.md (2)
5-7
: Use a Markdown heading instead of bold text for the changeset title
Markdownlint (MD036) flags emphasis used as a heading. It’s clearer to use an actual heading for the summary line.- **Add account deletion support when unlinking profiles** + # Add account deletion support when unlinking profiles🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
5-5: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
9-23
: Convert example section labels to headings
For better structure and consistency, replace the bold example labels with Markdown headings (e.g.,## React Hook Example
) and remove the trailing colon. This improves readability in rendered docs.- **React Hook Example:** + ## React Hook Example @@ - ```tsx + ```tsx @@ - **Direct Function Example:** + ## Direct Function Example
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
.changeset/account-deletion-unlink.md
(1 hunks)packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.test.tsx
(2 hunks)packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts
(3 hunks)packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.test.tsx
(2 hunks)packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts
(3 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.test.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/core/authentication/types.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/native/auth/index.ts
(1 hunks)packages/thirdweb/src/wallets/in-app/native/native-connector.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts
(2 hunks)packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
- packages/thirdweb/src/wallets/in-app/core/authentication/types.ts
- packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.test.ts
- packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts
- packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.ts
- packages/thirdweb/src/wallets/in-app/native/auth/index.ts
- packages/thirdweb/src/wallets/in-app/native/native-connector.ts
- packages/thirdweb/src/wallets/in-app/core/interfaces/connector.ts
- packages/thirdweb/src/wallets/in-app/core/authentication/linkAccount.ts
- packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.ts
- packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
.changeset/account-deletion-unlink.md
5-5: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Build Packages
- GitHub Check: Unit Tests
- GitHub Check: Analyze (javascript)
🔇 Additional comments (7)
.changeset/account-deletion-unlink.md (2)
1-3
: Frontmatter is correct
The YAML frontmatter properly declares a patch bump for thethirdweb
package. No changes needed here.
27-35
: Example usage is clear and accurate
The TypeScript snippet forunlinkProfile
correctly demonstrates theallowAccountDeletion
flag in action. No further changes needed here.packages/thirdweb/src/react/web/hooks/wallets/useUnlinkProfile.test.tsx (2)
43-43
: LGTM! Default parameter correctly tested.The test correctly verifies that
allowAccountDeletion
defaults tofalse
when not explicitly provided.
74-74
: LGTM! Ecosystem wallet test correctly updated.The ecosystem wallet test case is properly updated to include the new parameter.
packages/thirdweb/src/react/native/hooks/wallets/useUnlinkProfile.test.tsx (3)
43-48
: LGTM! Default parameter correctly tested.The test correctly verifies that
allowAccountDeletion
defaults tofalse
when not explicitly provided.
50-73
: Excellent test coverage for the new parameter!This test case properly verifies that when
allowAccountDeletion: true
is explicitly passed, it's correctly forwarded to the underlyingunlinkProfile
function. The test structure follows the existing pattern and provides comprehensive coverage.
99-99
: LGTM! Ecosystem wallet test correctly updated.The ecosystem wallet test case is properly updated to include the new parameter with its default value.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7211 +/- ##
=======================================
Coverage 55.63% 55.63%
=======================================
Files 908 908
Lines 58531 58546 +15
Branches 4130 4128 -2
=======================================
+ Hits 32561 32572 +11
- Misses 25864 25868 +4
Partials 106 106
🚀 New features to boost your workflow:
|
Fixes TOOL-4637
PR-Codex overview
This PR introduces an optional
allowAccountDeletion
parameter to theunlinkProfile
functionality, enabling the deletion of an entire account when unlinking the last associated profile. This enhances user control over profile management.Detailed summary
allowAccountDeletion
parameter tounlinkProfile
in various files.allowAccountDeletion
.unlinkAccount
function to handle account deletion logic.Summary by CodeRabbit
New Features
Documentation