You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was a timing issue clicking on the Continue button for the popup This game contains mature content ....
Fixed by adding a delay to the click.
Introduced issue of Target closed exception if a 18+ game was already claimed and context.close() was executed while the delayed click promise was still not done (unclear why this should happen since click should block).
Original comment:
Just tested Mordhau (18+):
Game was claimed successfully, but got Timeout waiting for locator('text=Thank you for buying') to be visible
Got Target closed exception sometimes when running afterwards.
Regarding 2., the problem is between clicking on the Continue button:
When commenting either out, I did not get Target closed.
However, without the click, the message stays there and the title of the game is not detected correctly, and without the close, it just waits around at the end.
Same effect when I removed the , { delay: 111 } from the click. Adding noWaitAfter had no effect.
So it seems like Playwright creates another promise with delay which then hangs around waiting.
Catching the exception to ignore it did not work - neither adding .catch(_ => { }) for the click, nor
node --stack-trace-limit=1000 epic-games.js also only showed internal Playwright calls in the trace:
This game contains mature content recommended only for ages 18+
clicked continue
waited
Current free game: MORDHAU
Already in library! Nothing to claim.
Current free game: Second Extinction™
Already in library! Nothing to claim.
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
ProtocolError: Target closed
at /fgc/node_modules/playwright-core/lib/server/firefox/ffConnection.js:189:16
at new Promise (<anonymous>)
at FFSession.send (/fgc/node_modules/playwright-core/lib/server/firefox/ffConnection.js:185:12)
at RawMouseImpl.move (/fgc/node_modules/playwright-core/lib/server/firefox/ffInput.js:91:24)
at Mouse.move (/fgc/node_modules/playwright-core/lib/server/input.js:153:23)
at Mouse.click (/fgc/node_modules/playwright-core/lib/server/input.js:180:12)
at /fgc/node_modules/playwright-core/lib/server/dom.js:468:109
at /fgc/node_modules/playwright-core/lib/server/dom.js:430:13
at FrameManager.waitForSignalsCreatedBy (/fgc/node_modules/playwright-core/lib/server/frames.js:114:26)
at ElementHandle._performPointerAction (/fgc/node_modules/playwright-core/lib/server/dom.js:424:57)
at async ElementHandle._retryPointerAction (/fgc/node_modules/playwright-core/lib/server/dom.js:342:22)
at async /fgc/node_modules/playwright-core/lib/server/frames.js:992:24
at async Frame.retryWithProgressAndTimeouts (/fgc/node_modules/playwright-core/lib/server/frames.js:914:24)
at async /fgc/node_modules/playwright-core/lib/server/frames.js:1012:29
at async ProgressController.run (/fgc/node_modules/playwright-core/lib/server/progress.js:92:22)
at async FrameDispatcher.click (/fgc/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js:149:12)
at async DispatcherConnection.dispatch (/fgc/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js:319:22) {
sessionClosed: true
}
Node.js v19.2.0
Extracted from #120:
Continue
button for the popupThis game contains mature content ...
.delay
to the click.Target closed
exception if a 18+ game was already claimed andcontext.close()
was executed while the delayed click promise was still not done (unclear why this should happen sinceclick
should block).Original comment:
Just tested Mordhau (18+):
waiting for locator('text=Thank you for buying') to be visible
Target closed
exception sometimes when running afterwards.Regarding 2., the problem is between clicking on the
Continue
button:free-games-claimer/epic-games.js
Line 120 in 351bf00
and closing the browser context at the end:
free-games-claimer/epic-games.js
Line 229 in 351bf00
When commenting either out, I did not get
Target closed
.However, without the click, the message stays there and the title of the game is not detected correctly, and without the close, it just waits around at the end.
Same effect when I removed the
, { delay: 111 }
from the click. AddingnoWaitAfter
had no effect.So it seems like Playwright creates another promise with
delay
which then hangs around waiting.Catching the exception to ignore it did not work - neither adding
.catch(_ => { })
for the click, nornode --stack-trace-limit=1000 epic-games.js
also only showed internal Playwright calls in the trace:Originally posted by @vogler in #120 (comment)
The text was updated successfully, but these errors were encountered: