Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(mobile): verify Metro source before takeover

Dash3136c2a06e63
diff --git a/apps/mobile/scripts/sim-start.mjs b/apps/mobile/scripts/sim-start.mjs
index e9fe1d7561..21f5d02a46 100644
--- a/apps/mobile/scripts/sim-start.mjs
+++ b/apps/mobile/scripts/sim-start.mjs
@@ -94,8 +94,12 @@ if (portArgs.port === DEFAULT_PORT) {
source: runningSource,
targetWorktree: worktreeRoot,
});
+ const listenerSourceIdentity = listener.confirmed
+ ? gitSourceIdentity(listener.worktree)
+ : null;
+ const listenerConfirmed = listener.confirmed && listenerSourceIdentity === runningSource;
- if (listener.confirmed && listener.isTarget) {
+ if (listenerConfirmed && listener.isTarget) {
// 是本 worktree 的 Metro —— 但还要确认它注入了**当前分支**的 git env,否则 build label branch
// 会是旧值/unknown(如手动 `expo start` 起的、或起好后切过分支),"已在跑"就成了假证据。
if (runningSource === sourceIdentity) {