-
Notifications
You must be signed in to change notification settings - Fork 0
Sync fork with upstream amaify/chainwright #2
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
Changes from all commits
1cd667c
89ae08f
959dd75
511f2d6
a571307
ddc1e04
ac59f0c
731fcbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,23 @@ | ||
| import type { Page } from "@playwright/test"; | ||
| import { sleep } from "@/utils/sleep"; | ||
|
|
||
| export async function autoClosePhantomNotification(page: Page, isCancelled: () => boolean) { | ||
| export async function autoClosePhantomNotification(page: Page, signal: AbortSignal) { | ||
| const INTERVAL = 300; | ||
| let IS_POLLING_COMPLETE = false; | ||
|
|
||
| while (!isCancelled()) { | ||
| const _isCancelled = isCancelled(); | ||
|
|
||
| // Check if notification is closed | ||
| // If it's closed or cancelled, there's no need to check again | ||
| if (_isCancelled || IS_POLLING_COMPLETE || page.isClosed()) break; | ||
|
|
||
| while (!signal.aborted && !page.isClosed()) { | ||
| try { | ||
| const notificationPopupBackButton = page.locator("div[id='modal']").locator("div > svg").first(); | ||
| const isNotificationButtonVisible = await notificationPopupBackButton.isVisible().catch(() => false); | ||
|
|
||
| if (isNotificationButtonVisible) { | ||
| await notificationPopupBackButton.click(); | ||
| IS_POLLING_COMPLETE = true; | ||
| return; | ||
|
Comment on lines
12
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Re-check cancellation immediately before clicking. An abort can occur while
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| } | ||
| } catch (error) { | ||
| if (page.isClosed()) break; | ||
| console.error("[autoClosePhantomNotification]: ", error); | ||
| if (page.isClosed()) return; | ||
| } | ||
|
|
||
| // Check if polling is complete | ||
| if (_isCancelled || IS_POLLING_COMPLETE || page.isClosed()) break; | ||
|
|
||
| await sleep(INTERVAL); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,6 @@ | |||||
| "@/tests/*": ["./tests/*"] | ||||||
| } | ||||||
| }, | ||||||
| "include": ["**/*.ts", "**/*.tsx"], | ||||||
| "include": ["src/**/*.ts", "tests/**/*.ts", "environment.d.ts"], | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Keep executable TypeScript entry points in the type-check scope.
Proposed fix- "include": ["src/**/*.ts", "tests/**/*.ts", "environment.d.ts"],
+ "include": ["src/**/*.ts", "tests/**/*.ts", "scripts/**/*.ts", "environment.d.ts"],📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "exclude": ["node_modules", "docs"] | ||||||
| } | ||||||
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Abort the notification runner in a
finallyblock.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