Skip to content

Webgl followups#201

Merged
kenforthewin merged 3 commits into
mainfrom
webgl-followups
May 16, 2026
Merged

Webgl followups#201
kenforthewin merged 3 commits into
mainfrom
webgl-followups

Conversation

@kenforthewin
Copy link
Copy Markdown
Owner

No description provided.

youssefsiam38 and others added 3 commits May 16, 2026 16:17
Chrome 102+ deprecates apple-mobile-web-app-capable and emits a console
warning on every page load asking for the unprefixed mobile-web-app-capable
to be included. Keep the Apple-prefixed tag for iOS Home Screen and add
the standard one alongside it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
LocalGraphView blew up the route-level Error Boundary with

    TypeError: Cannot read properties of null (reading 'blendFunc')
        at new Sigma (...)

whenever Sigma's constructor called gl.blendFunc(...) on a null WebGL
context. The root cause is the browser's per-tab WebGL context cap
(~16 on Chrome, ~8 on Safari): sigma.kill() detaches the canvas but the
underlying GL context lingers until GC, so rapid re-centers of the local
graph (combined with the always-mounted main SigmaCanvas) eventually
exhaust the pool. The next `new Sigma` then receives a canvas whose
getContext returns null and crashes on the first GL state call.

Two changes:

1. Introduce a releaseSigma() helper that calls sigma.kill() and then
   explicitly invokes WEBGL_lose_context.loseContext() on every canvas
   inside the container. That frees the GL slot immediately rather than
   waiting on GC. Use it from both the in-effect "previous sigma" cleanup
   and the effect's return cleanup.
2. Wrap `new Sigma(...)` in try/catch. If the context can't be acquired
   we surface a friendly error state instead of letting the crash hit
   the Error Boundary and blank the whole page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kenforthewin kenforthewin merged commit 6c81081 into main May 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants