Sync fork with upstream amaify/chainwright#2
Conversation
…ring-onboarding [Solflare] - Close the "what's new" modal during onboarding
[Linting] - Fix the linting issue that prevents deployment.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WalkthroughThe change introduces AbortSignal-based notification cancellation for Phantom and Solflare flows, adds combined lint and TypeScript CI checks, narrows TypeScript inclusion, and updates release metadata and notes. ChangesNotification cancellation
CI and release configuration
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8).github/workflows/linting-and-unit-tests.yamlTraceback (most recent call last): package.jsonTraceback (most recent call last): tsconfig.jsonTraceback (most recent call last): Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/wallets/phantom/actions/onboard.phantom.ts`:
- Around line 202-208: Ensure the notification runners are always stopped by
moving abort calls into finally blocks: in
src/wallets/phantom/actions/onboard.phantom.ts lines 202-208, wrap the
additional-account flow around autoClosePhantomNotification in try/finally and
abort autoCloseController in finally; apply the same try/finally cleanup to the
post-runner onboarding work in src/wallets/solflare/actions/onboard.solflare.ts
lines 46-64, aborting its controller in finally.
In `@src/wallets/phantom/utils.ts`:
- Around line 12-14: In the click conditions of the notification back-button
flows, re-check both cancellation and page state immediately before clicking:
update src/wallets/phantom/utils.ts lines 12-14 and
src/wallets/solflare/utils.ts lines 17-19 to require !signal.aborted and
!page.isClosed() alongside visibility before invoking the click.
In `@tsconfig.json`:
- Line 26: Update the TypeScript include configuration in tsconfig.json to cover
executable entry points under scripts/**/*.ts, ensuring scripts such as
add-wallet.ts are checked by check:types alongside the existing source and test
patterns.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8e9b6429-f49b-4056-ad3a-66103b55688b
⛔ Files ignored due to path filters (2)
dist/wallets/phantom/index.jsis excluded by!**/dist/**dist/wallets/solflare/index.jsis excluded by!**/dist/**
📒 Files selected for processing (12)
.github/workflows/linting-and-unit-tests.yamlCHANGELOG.mdpackage.jsonsrc/wallets/phantom/actions/onboard.phantom.tssrc/wallets/phantom/phantom-fixture.tssrc/wallets/phantom/phantom-worker-scope-fixture.tssrc/wallets/phantom/utils.tssrc/wallets/solflare/actions/onboard.solflare.tssrc/wallets/solflare/solflare-fixture.tssrc/wallets/solflare/solflare-worker-scope-fixture.tssrc/wallets/solflare/utils.tstsconfig.json
| const autoCloseController = new AbortController(); | ||
|
|
||
| autoClosePhantomNotification(newPage, isCancelled).catch((error) => console.error({ error })); | ||
| autoClosePhantomNotification(newPage, autoCloseController.signal).catch((error) => console.error({ error })); | ||
|
|
||
| for (const { accountName, chain, privateKey } of additionalAccounts) { | ||
| await addAccount({ page: newPage, privateKey, accountName, chain }); | ||
| cancelled = true; | ||
| autoCloseController.abort(); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Abort the notification runner in a finally block.
A failed account, rename, or network action skips abort(), leaving the runner polling until page teardown.
src/wallets/phantom/actions/onboard.phantom.ts#L202-L208: wrap the additional-account flow intry/finallyand abort infinally.src/wallets/solflare/actions/onboard.solflare.ts#L46-L64: wrap the post-runner onboarding work intry/finallyand abort infinally.
📍 Affects 2 files
src/wallets/phantom/actions/onboard.phantom.ts#L202-L208(this comment)src/wallets/solflare/actions/onboard.solflare.ts#L46-L64
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/wallets/phantom/actions/onboard.phantom.ts` around lines 202 - 208,
Ensure the notification runners are always stopped by moving abort calls into
finally blocks: in src/wallets/phantom/actions/onboard.phantom.ts lines 202-208,
wrap the additional-account flow around autoClosePhantomNotification in
try/finally and abort autoCloseController in finally; apply the same try/finally
cleanup to the post-runner onboarding work in
src/wallets/solflare/actions/onboard.solflare.ts lines 46-64, aborting its
controller in finally.
| if (isNotificationButtonVisible) { | ||
| await notificationPopupBackButton.click(); | ||
| IS_POLLING_COMPLETE = true; | ||
| return; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Re-check cancellation immediately before clicking.
An abort can occur while isVisible() is awaited. The current iteration can then click a notification after fixture teardown or onboarding cancellation.
src/wallets/phantom/utils.ts#L12-L14: include!signal.abortedand!page.isClosed()in the click condition.src/wallets/solflare/utils.ts#L17-L19: include!signal.abortedand!page.isClosed()in the click condition.
📍 Affects 2 files
src/wallets/phantom/utils.ts#L12-L14(this comment)src/wallets/solflare/utils.ts#L17-L19
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/wallets/phantom/utils.ts` around lines 12 - 14, In the click conditions
of the notification back-button flows, re-check both cancellation and page state
immediately before clicking: update src/wallets/phantom/utils.ts lines 12-14 and
src/wallets/solflare/utils.ts lines 17-19 to require !signal.aborted and
!page.isClosed() alongside visibility before invoking the click.
| } | ||
| }, | ||
| "include": ["**/*.ts", "**/*.tsx"], | ||
| "include": ["src/**/*.ts", "tests/**/*.ts", "environment.d.ts"], |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep executable TypeScript entry points in the type-check scope.
check:types now excludes scripts/add-wallet.ts, even though it is an exposed project script. A broken script can therefore pass CI and fail only when invoked; include scripts/**/*.ts or document why it is intentionally excluded.
Proposed fix
- "include": ["src/**/*.ts", "tests/**/*.ts", "environment.d.ts"],
+ "include": ["src/**/*.ts", "tests/**/*.ts", "scripts/**/*.ts", "environment.d.ts"],📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "include": ["src/**/*.ts", "tests/**/*.ts", "environment.d.ts"], | |
| "include": ["src/**/*.ts", "tests/**/*.ts", "scripts/**/*.ts", "environment.d.ts"], |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tsconfig.json` at line 26, Update the TypeScript include configuration in
tsconfig.json to cover executable entry points under scripts/**/*.ts, ensuring
scripts such as add-wallet.ts are checked by check:types alongside the existing
source and test patterns.
Merges the latest
devfrom upstream (amaify/chainwright) into this fork, and rebuildsdistso git installs pick up the new code.Upstream changes pulled in:
🤖 Generated with Claude Code
Summary
devchanges and rebuildsdistfor Git-based installs.AbortControllersignals for Phantom and Solflare onboarding flows.0.10.11and updates the changelog.