From ac8455774093225aed186921b4ecf201d24d83b9 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 9 Sep 2026 17:25:18 +0200 Subject: [PATCH] :bug: Re-upload WASM text after WebGL context restore (#11589) During reload-renderer!, reloading? keeps initialized?/ready? false while set-objects runs (especially the sync path for small files). Text content used that guard and was skipped; geometry already used live?. Gate use-shape, has-shape, and set-shape-text-content on wasm/live? so text is restored with the rest of the shapes. --- frontend/src/app/render_wasm/api.cljs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/render_wasm/api.cljs b/frontend/src/app/render_wasm/api.cljs index c24bcf0460..e24a06acbc 100644 --- a/frontend/src/app/render_wasm/api.cljs +++ b/frontend/src/app/render_wasm/api.cljs @@ -658,7 +658,9 @@ (defn use-shape [id] - (when (initialized?) + ;; Use `wasm/live?` (not `initialized?`) so context-restore reload can + ;; select shapes while `reloading?` still blocks external app callers. + (when (wasm/live?) (let [buffer (uuid/get-u32 id)] (h/call wasm/internal-module "_use_shape" (aget buffer 0) @@ -668,7 +670,7 @@ (defn has-shape [id] - (when (initialized?) + (when (wasm/live?) (let [buffer (uuid/get-u32 id) result @@ -686,9 +688,11 @@ ;; Cache content for text editor sync (text-editor/cache-shape-text-content! shape-id content) - ;; The WASM design state may not be ready (e.g. while switching renderer - ;; with a text shape being edited). Skip the WASM layout calls in that case. - (when (initialized?) + ;; Skip when the GL/WASM context is not usable. Use `wasm/live?` (not + ;; `initialized?`) so context-restore reload can re-upload text while + ;; `reloading?` still blocks external app callers. Geometry shapes already + ;; use `live?` via `set-shape-base-props`; text must match that path. + (when (wasm/live?) (h/call wasm/internal-module "_clear_shape_text") (set-shape-vertical-align (get content :vertical-align))