|
@@ -3258,7 +3258,7 @@ const messageInit = () => {
|
|
|
console.log('🔗 messageInit: doc.guid=', doc.guid, 'boundDoc=', boundDoc?.guid, 'same=', boundDoc === doc)
|
|
console.log('🔗 messageInit: doc.guid=', doc.guid, 'boundDoc=', boundDoc?.guid, 'same=', boundDoc === doc)
|
|
|
if (boundDoc === doc) {
|
|
if (boundDoc === doc) {
|
|
|
// 同 doc 重连:补发上线消息即可
|
|
// 同 doc 重连:补发上线消息即可
|
|
|
- if (props.type === '2') {
|
|
|
|
|
|
|
+ if (props.type === '2' && opRes.value.length === 0) {
|
|
|
sendMessage({ type: 'class_begin', courseid: props.courseid })
|
|
sendMessage({ type: 'class_begin', courseid: props.courseid })
|
|
|
}
|
|
}
|
|
|
return
|
|
return
|
|
@@ -3496,7 +3496,7 @@ const messageInit = () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 新 doc 绑定完成,补发上线消息
|
|
// 新 doc 绑定完成,补发上线消息
|
|
|
- if (props.type === '2') {
|
|
|
|
|
|
|
+ if (props.type === '2' && opRes.value.length === 0) {
|
|
|
sendMessage({ type: 'class_begin', courseid: props.courseid })
|
|
sendMessage({ type: 'class_begin', courseid: props.courseid })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -4121,6 +4121,7 @@ onMounted(() => {
|
|
|
'9. doc 里所有顶层 key': Array.from(doc.share.entries()).map(([k, v]: [string, any]) => k + ':' + v.constructor.name),
|
|
'9. doc 里所有顶层 key': Array.from(doc.share.entries()).map(([k, v]: [string, any]) => k + ':' + v.constructor.name),
|
|
|
'10. provider synced': providerSocket.value?.synced,
|
|
'10. provider synced': providerSocket.value?.synced,
|
|
|
'11. ws.readyState': providerSocket.value?.ws?.readyState,
|
|
'11. ws.readyState': providerSocket.value?.ws?.readyState,
|
|
|
|
|
+ '12. messageV3?.get("slidesIndex")': msgV3Type?.get?.('slidesIndex'),
|
|
|
}
|
|
}
|
|
|
console.log('════════ Yjs 诊断 ════════')
|
|
console.log('════════ Yjs 诊断 ════════')
|
|
|
for (const [k, v] of Object.entries(report)) {
|
|
for (const [k, v] of Object.entries(report)) {
|
|
@@ -4624,7 +4625,7 @@ const createWebSocketConnection = async (type = 1) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 学生端补发上线消息,让老师知道学生已就绪
|
|
// 学生端补发上线消息,让老师知道学生已就绪
|
|
|
- if (props.type === '2') {
|
|
|
|
|
|
|
+ if (props.type === '2' && opRes.value.length === 0) {
|
|
|
console.log('🔗 sync handler: yMessage.value =', yMessage.value ? '已绑定' : 'null', 'doc.guid=', docSocket.value?.guid)
|
|
console.log('🔗 sync handler: yMessage.value =', yMessage.value ? '已绑定' : 'null', 'doc.guid=', docSocket.value?.guid)
|
|
|
sendMessage({ type: 'class_begin', courseid: props.courseid })
|
|
sendMessage({ type: 'class_begin', courseid: props.courseid })
|
|
|
// ★ 确认 class_begin 是否真的写入了 messageV3
|
|
// ★ 确认 class_begin 是否真的写入了 messageV3
|