From 266ef6a1846d1feb83c351c30c86a571d7da14d9 Mon Sep 17 00:00:00 2001 From: OpenAI Codex Date: Wed, 9 Sep 2026 20:42:17 +0800 Subject: [PATCH] fix: serialize WeatherV2 particle loads --- .../App.tsx | 9 ++++++-- packages/maplibre-particle-rn/CHANGELOG.md | 1 + .../src/weatherV2/loadIntoWeatherRuntime.ts | 21 ++++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/integration/react-native/MapLibreParticlePackageConsumerTestHost/App.tsx b/integration/react-native/MapLibreParticlePackageConsumerTestHost/App.tsx index f65835531..d2953ffb5 100644 --- a/integration/react-native/MapLibreParticlePackageConsumerTestHost/App.tsx +++ b/integration/react-native/MapLibreParticlePackageConsumerTestHost/App.tsx @@ -20,6 +20,7 @@ export default function App() { const [frames, setFrames] = useState>({ T0: "PENDING", T1: "PENDING", T2: "PENDING", T3: "PENDING" }); const [transport, setTransport] = useState("PENDING: FILE_REF / FLOAT32_LE / INTERLEAVED_UV"); const [httpTransport, setHttpTransport] = useState("PENDING: WeatherV2 HTTP → canonical U/V → WeatherRuntime"); + const [httpLoading, setHttpLoading] = useState(false); const [weatherVisible, setWeatherVisible] = useState(true); const [particleVisible, setParticleVisible] = useState(true); const [visual, setVisual] = useState(initialVisual); @@ -61,6 +62,8 @@ export default function App() { const loadHttpWeather = useCallback(async () => { if (reactTag == null) return setResult("MAP_NOT_READY: wait for GSI/style ready"); + if (httpLoading) return; + setHttpLoading(true); try { setHttpTransport("LOADING: manifest → time index → WVECBIN1 → canonical U/V"); const loaded = await loadHttpWeatherV2(reactTag); @@ -71,8 +74,10 @@ export default function App() { } catch (error) { setHttpTransport(`ERROR: ${String(error)}`); setResult(`LOAD HTTP WEATHER: ${String(error)}`); + } finally { + setHttpLoading(false); } - }, [reactTag]); + }, [httpLoading, reactTag]); const updateVisual = useCallback((key: keyof typeof initialVisual, value: string) => setVisual((current) => ({ ...current, [key]: value })), []); const applyVisual = useCallback(() => void command("particle visual", async (tag) => { @@ -93,7 +98,7 @@ export default function App() { Basemap: GSI {basemap}Dataset: ECMWF HRES 20260807 · 513×769 · 3.01 MiB/frameRuntime: {snapshot.state} / {snapshot.playbackState} / {snapshot.targetFps}REAL DATA TRANSPORT = {transport} {realWeatherFrames.map((frame) => {frame.label} {frame.cycle}: {frames[frame.label]})} {result}