bug: 安卓打开任务无限停留在“正在同步”(偶现)
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
### 问题描述 / What happened
打开一个任务后,任务详情页进入首轮同步流程,但同步状态始终没有结束:
页面显示“正在同步”加载态;
消息列表为空;
长时间等待后仍不会显示任务内容;
也没有超时错误、失败提示或可用的重试按钮;
返回后重新进入仍复现。
软件重启后恢复正常,感觉就是没连上,都打不开
### 环境 / Environment
设备:小米 10,edb65576
App:com.xd.cindycn
版本:0.1.14 (build 26)
任务:81-72
现象:进入任务详情后,页面一直显示“正在同步”,消息内容不出现;顶部任务标题和工具栏已正常显示,页面没有错误提示或重试入口。
复现期间 App 进程仍存活,没有捕获到崩溃。
### 复现步骤 / Steps to reproduce
初步定位
问题不在 UI 加载动画本身,而是详情页的同步状态机没有收口。
当前详情页在 apps/mobile/app/sessions/[sessionId].tsx 中会并行等待:
会话消息历史;
pending interactions;
input projection;
active session snapshot。
全部 Promise 通过 waitForIndependentSnapshotReads(Promise.allSettled(...)) 汇总后,才会执行 setLoading(false)。只要其中一个远程读取或历史视图刷新 Promise 一直不 settle,页面就会永久保持 loading=true,最终表现为无限“正在同步”。
重点怀疑链路:
historyView.view.refresh(...) / maker.listMessages(...);
device-link 半开或远端无响应时,请求没有正确进入超时/失败分支;
或请求虽然已失效,但没有触发当前同步代际的取消和 finally 收口。
代码虽然配置了默认 15 秒 invoke timeout,但本次现场没有出现错误提示,说明至少有一条同步 Promise 可能绕过了统一超时,或被 single-flight / history view 层卡住。
### 日志与截图 / Logs & screenshots
https://github.com/user-attachments/assets/9e61e437-b58b-4f69-bf02-ccff8e84a36e
Contributor guide
Research direction
Start in apps/mobile/app/sessions/[sessionId].tsx and trace waitForIndependentSnapshotReads around the four parallel reads, especially historyView.view.refresh(...) and maker.listMessages(...). Reproduce the stalled synchronization and inspect whether each Promise reaches timeout, cancellation, or failure handling. Done means a failed or unresponsive read no longer leaves the detail page permanently showing “正在同步”, and the user receives the available failure or retry state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100