fix: refresh cached miniapp urls#15146
Merged
DeJeune merged 2 commits intoMay 28, 2026
Merged
Conversation
GeorgeDong32
approved these changes
May 18, 2026
Collaborator
GeorgeDong32
left a comment
There was a problem hiding this comment.
Code Review: LGTM ✅
变更精准修复了 #14415,符合 hotfix 最小范围原则。
核心改动: 将 mini-app 缓存策略从"仅缓存新条目"改为"始终刷新缓存",确保动态 URL(如 OpenClaw 带 auth token 的 dashboard URL)在重新打开时获取最新 URL。
审查要点:
- ✅ 正确性:
LRUCache.set()对已有 key 原地更新,行为正确 - ✅ 安全性: 确保 auth token 每次打开时刷新,避免使用过期 token
- ✅ 性能: 移除不必要的
get()调用,set()同样会将条目移到最近使用位置 - ✅ 一致性: 两处改动(
openMinapp和openSmartMinapp)保持相同模式 - ✅ CI 全部通过
Signed-off-by: mehmet turac <mehmetturac@gmail.com>
95d72c3 to
b283e63
Compare
ousugo
reviewed
May 18, 2026
Collaborator
ousugo
left a comment
There was a problem hiding this comment.
该 PR 成功修复了 OpenClaw 等动态小应用 URL 刷新滞后的问题。通过强制更新缓存,确保了 Token 的实时性。建议在 \useMinappPopup\ 中增加配置变化检查,以避免在 URL 未变动时触发不必要的组件重绘或 WebView 重新加载。此外,注意到 Tab 模式下部分状态同步可能存在微小延迟,但不影响核心功能修复。
| if (!cacheApp) minAppsCache.set(app.id, app) | ||
| // Always refresh the cached config. Some apps, such as OpenClaw, use | ||
| // short-lived URLs with auth tokens and must not reuse a stale entry. | ||
| minAppsCache.set(app.id, app) |
Collaborator
There was a problem hiding this comment.
[B1] 每次调用 \openMinapp\ 都会触发 \minAppsCache.set\,即便 \�pp\ 的配置(特别是 \url\)没有发生变化。这会导致 Redux 状态产生新的引用并触发相关组件重绘,对于已打开的 WebView 也会导致其重新加载。建议在 \set\ 之前检查 \url\ 是否变化以避免不必要的重载。
| } | ||
| // Refresh temporary app config so dynamic URLs such as OpenClaw's | ||
| // dashboard token are propagated when the tab already exists. | ||
| minAppsCache.set(config.id, config) |
Collaborator
There was a problem hiding this comment.
[B1] 同上,在 \openSmartMinapp\(Tab 模式)中,点击已激活的 Tab 也会触发强制刷新。建议增加变化检查以保持与其它 Tab 系统一致的交互体验。
DeJeune
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Before this PR:
Opening a keep-alive mini-app with an existing id reused the cached app config without refreshing its URL. Dynamic mini-app URLs, including the OpenClaw dashboard URL with its auth token, could therefore reopen with a stale tokenless URL.
After this PR:
Keep-alive mini-app opens always refresh the cached config before showing the app. Existing OpenClaw dashboard tabs now receive the latest tokenized URL from
getDashboardUrl().Fixes #14415
Why we need it and why it was done in this way
The following tradeoffs were made:
This keeps the fix in the shared mini-app cache path instead of adding OpenClaw-specific reload code, so every dynamic mini-app URL benefits from the same behavior.
The following alternatives were considered:
Closing and recreating the OpenClaw dashboard tab on every open was considered, but refreshing the cached config is smaller and preserves the existing keep-alive behavior.
Links to places where the discussion took place: #14415
Breaking changes
None.
Special notes for your reviewer
Touched surface: renderer mini-app popup cache behavior. Validation run:
corepack pnpm biome check src/renderer/src/hooks/useMinappPopup.tscorepack pnpm exec tsc --noEmit -p tsconfig.web.json --composite falseChecklist
Release note