Repository navigation
fix(migrated): gate image submits behind DOM checks with typed failures #781
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
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2709,7 +2709,19 @@ async def _drive_images_generation( | |
| msg, | ||
| ) | ||
| page_owned = getattr(self.transport, "uses_page_owned_image_recaptcha", None) | ||
| serve_migrated = False | ||
| if callable(page_owned) and page_owned(): | ||
| from gflow_cli.api.transports.migrated_composer import ( # noqa: PLC0415 | ||
| migrated_images_prefer, | ||
| ) | ||
|
|
||
| # The capability answers from the page URL alone and cannot see the | ||
| # request: re-check servability here so entity/instruction runs and | ||
| # project-less runs keep their pre-minted token. A redundant mint on | ||
| # a migrated run is harmless (the page mints its own); a missing mint | ||
| # on a labs run is a terminal auth failure. | ||
| serve_migrated = migrated_images_prefer(req, project_id=project_id) | ||
|
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 Preserve whether the caller supplied a project ID. When Carry an explicit caller-supplied flag through both decisions. Keep project-less requests on the labs flow and mint their token, while continuing to pass the resolved ID to the transport so it does not create a second project. 🤖 Prompt for AI Agents |
||
| if serve_migrated: | ||
| # The migrated Angular page mints and submits its own token on ogiZ0b. | ||
| # Minting here first is not only redundant: the pooled bootstrap page is | ||
| # flow.google.com/ (no enterprise.js), while /project/<id> is the page that | ||
|
|
||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: ffroliva/gflow-cli
Length of output: 11840
🏁 Script executed:
Repository: ffroliva/gflow-cli
Length of output: 14603
🏁 Script executed:
Repository: ffroliva/gflow-cli
Length of output: 14413
Correct the cookie-dismissal error claim.
MigratedComposer._dismiss_cookie_barcatches dismissal errors, logs a warning, and returns. It does not raiseUiSelectorDriftError. The pre-submit gate raises that error only for remaining blocking overlays and invalid submit targets. Document cookie dismissal as best-effort, and retain typed drift errors for the overlay and submit-target checks.🤖 Prompt for AI Agents