查询结果
const r = await mn.api('/writing/pencil-result', {
method: 'POST',
body: { requestId }
});
if (r.error && r.error.code === 'NOT_FOUND') {
// 本进程里没有该笔,MarginNote 重启过;不要视为没有保存
}
if (r.layerLeaseUnresolved) {
// 有租约悬留,结果不确定,不要自动重试
}{
"settled": true,
"outcome": "entered",
"persistedSnapshotVerified": true,
"snapshotCurrent": true,
"ready": false,
"canSwitch": false
}手写会话
查询笔迹保存结果
用提交时的 requestId 查同一笔操作的最终结果。
settled 为真只说明返回调已返回,还要分别看 outcome、persistedSnapshotVerified
与 snapshotCurrent。snapshotCurrent 只描述返回调返回时的状态。
受理之后才出现的失败码走响应里的 code,不走错误对象里的 code。
查不到记录时返回 404,说明本进程里没有这笔,不等于没有保存过。
POST
/
writing
/
pencil-result
查询结果
const r = await mn.api('/writing/pencil-result', {
method: 'POST',
body: { requestId }
});
if (r.error && r.error.code === 'NOT_FOUND') {
// 本进程里没有该笔,MarginNote 重启过;不要视为没有保存
}
if (r.layerLeaseUnresolved) {
// 有租约悬留,结果不确定,不要自动重试
}{
"settled": true,
"outcome": "entered",
"persistedSnapshotVerified": true,
"snapshotCurrent": true,
"ready": false,
"canSwitch": false
}响应
结果。受理之后的失败码在响应的 code 上。
提交类操作的最终结果。看 settled、outcome、persistedSnapshotVerified 与 snapshotCurrent,不要只看 HTTP 状态码。