readActiveRestoreSession()
function readActiveRestoreSession(executor, branchId): Promise<
| WorkingTreeRestoreSessionInfo
| null>;
Defined in: packages/rxdb-plugin-working-tree/src/working-tree/restore-command.ts:471
读当前分支那个未结束的恢复会话,没有就是 null。
Parameters
| Parameter | Type | Description |
|---|---|---|
executor | TransactionExecutor | 当前事务执行器 |
branchId | string | 目标分支 |
Returns
Promise<
| WorkingTreeRestoreSessionInfo
| null>
见 WorkingTreeRestoreSessionInfo;无未结束会话时为 null
Remarks
查询本身走 readActiveRestoreSessionRow,与 status.ts 的 readRestoreBits
同一份:判据是 activeKey IS NOT NULL 而不是 status = 'active',两者看着等价,
区别在 conflicted——那种会话的 activeKey 仍然占着索引、仍然要被用户处理掉,按状态筛
会让它在这个入口上凭空消失,而唯一索引那边它还在。
本函数只做一件额外的事:把行收窄成 WorkingTreeRestoreSessionInfo 再出包。
直接把实体行交出去的话,调用方就能改它的 status / activeKey——而终态转换只允许经由
restore-session-transitions.ts,那里 SQL 与内存行是一起改的。