Skip to content

fix(classic): drive the portal even when the page never finishes loading (issue #356) - #362

Open
lshw54 wants to merge 1 commit into
codefrom
fix/classic-ready-timeout
Open

fix(classic): drive the portal even when the page never finishes loading (issue #356)#362
lshw54 wants to merge 1 commit into
codefrom
fix/classic-ready-timeout

Conversation

@lshw54

@lshw54 lshw54 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

What

Follow-up on #356. The reporter narrowed it down precisely:

在關閉硬體加速的情境下,不會 popup 出登入視窗,啟用後即正常運作

Two separate problems, and the first one confirms an earlier diagnosis.

1. No portal window with hardware acceleration off — already fixed, not yet released

This is the WebView2 environment mismatch fixed in 3e4eb44, and the hardware-acceleration correlation is independent confirmation of it:

Hardware acceleration Main window args Portal args (before the fix) Result
On wry defaults wry defaults identical → works
Off defaults + --disable-gpu --disable-gpu-compositing wry defaults mismatch → ERROR_INVALID_STATE → no webview

Every WebView2 environment sharing a user data folder must be configured identically; the portal reused the per-instance folder but not the args, so turning hardware acceleration off was exactly what made the two diverge. The fix has the portal inherit the main window's args.

It landed after the v6.0.10 tag, so the reporter's build does not contain it — the next release does.

2. Never clicks GamaPass by itself — fixed here

Every step in the portal script waited for document.readyState === 'complete', which waits for every subresource. One hung request — an analytics script an accelerator / VPN / content blocker swallows, or a slow CDN — and that state never arrives, so the gate never opened and no step ever ran: the sign-in click, the consent, the account selection, all of them. The window just sat there looking alive.

The gate now falls back to URL stability after ~5 s (the URL has been unchanged that whole time, so the document we can see is the one we are going to get) and posts a ready-timeout message naming the document state and href, so the same situation shows up in the log instead of looking idle.

Checks

1025 Rust tests, 681 frontend tests, clippy clean under -D warnings, fmt clean.

…ing (issue #356)

Follow-up report: with hardware acceleration OFF no portal window
appeared at all, and with it ON the window appeared but never clicked
GamaPass by itself.

The first half is the environment mismatch already fixed in 3e4eb44 —
and the hardware-acceleration correlation confirms that diagnosis
independently: turning it off adds --disable-gpu / --disable-gpu-compositing
to the main window's browser args, which the portal did not inherit, so
its environment no longer matched the shared user data folder and
WebView2 refused it (ERROR_INVALID_STATE). With acceleration on, both
sides happened to be wry's defaults, so it worked. That fix landed
AFTER the v6.0.10 tag, so the reporter's build does not have it.

The second half is this commit. Every step waited for readyState
"complete", which waits for EVERY subresource — one hung request (an
analytics script an accelerator / VPN / blocker swallows, a slow CDN)
meant the gate never opened and no step ever ran: the sign-in click,
the consent, the account selection, all of them. The window just sat
there, which is exactly what "it doesn't click GamaPass by itself"
looks like.

The gate now falls back to URL stability after ~5s and posts a
ready-timeout message naming the document state and href, so the same
situation is diagnosable from the log instead of looking idle.

1025 Rust tests, 681 frontend tests, clippy clean under -D warnings.
@lshw54 lshw54 self-assigned this Aug 6, 2026
@lshw54 lshw54 added the bug Something isn't working label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant