Repository navigation
Conversation
…10792) * fix(google-maps): wait for shared context in interleaved mode Co-authored-by: Codex <noreply@openai.com> * fix(google-maps): keep context creation callbacks on the same mode Bind the positioning callback to the mode already selected for the WebGL callback. A setProps change before onAdd must not skip standalone Deck creation or create an interleaved Deck without Google's context. Add regression coverage for both mutations before callbacks run. Co-authored-by: Codex <noreply@openai.com> * fix(google-maps): draw with the original overlay mode Keep onDraw on the mode selected for the context lifecycle callbacks. Updating interleaved while those callbacks are pending or after Deck initializes must not draw through the other context path. Cover both callback orders and prop-change timings with creation and drawing assertions. Co-authored-by: Codex <noreply@openai.com> * test(google-maps): release Deck-owned WebGL contexts Standalone Decks in the new tests each created a WebGL context that was never released, so Chromium evicted the shared test device and later suites failed to link shaders. --------- Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Chris Gervang <chrisgervang@users.noreply.github.com> Co-authored-by: Chris Gervang <chris.gervang@joby.aero> (cherry picked from commit d9e395c)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c511bc484
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!interleaved) { | ||
| // @ts-ignore (TS2345) map is defined at this stage | ||
| // Pass the positioning overlay for deck canvas creation (not WebGL overlay) | ||
| this._deck = createDeckInstance(this._map, overlay, this._deck, this.props); |
There was a problem hiding this comment.
Pass the bound mode into standalone Deck creation
When interleaved starts as false but setProps({interleaved: true}) runs before the positioning onAdd callback, this branch correctly stays on the standalone path, yet it passes the now-mutated this.props to createDeckInstance. In modules/google-maps/src/utils.ts:63, that true value suppresses the standalone canvas's pointerEvents: 'none' style, leaving the dedicated canvas pointer-active above Google Maps even though drawing remains non-interleaved; override the creation props with the callback's bound mode.
Useful? React with 👍 / 👎.
| overlay.onAdd = noop; | ||
| overlay.onContextRestored = interleaved ? this._onContextRestored.bind(this) : noop; | ||
| overlay.onDraw = this._onDrawVector.bind(this); | ||
| overlay.onDraw = this._onDrawVector.bind(this, interleaved); |
There was a problem hiding this comment.
Use the bound mode when detaching the overlay
When the overlay was bound with interleaved: true and that prop is later changed to false, this callback continues using shared rendering as intended, but setMap(null) at line 77 still checks mutable this.props.interleaved. It therefore skips the requestRedraw() used to repaint the Google canvas after removing an interleaved overlay, so the last deck frame can remain visible until an unrelated map repaint; retain and use the bound mode for teardown as well.
Useful? React with 👍 / 👎.
Backport of #10792 to
9.4-release, as requested in that PR, so the fix can ship in a 9.4.x patch.Closes #10704, #10059 and #10056 on the 9.4 line.
git cherry-pick -x d9e395capplied cleanly:modules/google-maps/src/google-maps-overlay.tsis identical onmasterand9.4-release. No other changes.Verified on this branch:
corepack yarn lint: passescorepack yarn test-headless --reporter=verbose test/modules/google-maps: 21 passedWe now run 9.4.0 in production, so a 9.4 patch is the release we need. We no longer need the 9.3 backport requested in #10792.
🤖 Generated with Claude Code
Note
Medium Risk
Touches vector-map WebGL lifecycle and rendering paths where wrong context timing can break interleaved compositing; behavior is narrowed by new regression tests but still affects production map integration.
Overview
Fixes interleaved vector
GoogleMapsOverlayso Deck is not created when the positioningOverlayViewfiresonAddbefore Google’s shared WebGL context is ready._onAddVectorOverlaynow receives theinterleavedflag at callback bind time and skipscreateDeckInstancewhen interleaved, leaving Deck creation to_onContextRestoredwith the map’sglcontext._onDrawVectoruses the same boundinterleavedvalue instead of readingthis.propson every draw.Tests cover both overlay callback orderings, interleaved vs standalone contexts, and map-motion rendering (
_drawLayersinto the shared context vsredrawon a separate canvas), plus safer WebGL teardown in vitest.Reviewed by Cursor Bugbot for commit 0c511bc. Bugbot is set up for automated code reviews on this repo. Configure here.