Error: errCode: -402002 realtime listener init watch fail | errMsg: login fail Error: invalid state: ws connection not exists, can not send message
history states: UNINIT-(loginStart)->INIT_LOGGING_IN-(loginFail)->INIT_LOGIN_FAIL-(loginStart)->INIT_LOGGING_IN-(loginFail)->INIT_LOGIN_FAIL-(loginStart)->INIT_LOGGING_IN-(loginFail)->INIT_LOGIN_FAIL-(close)->CLOSED
at _FSMListener (WASubContext.js?t=wechat&s=1683950966850&v=2.25.3:1)
at WASubContext.js?t=wechat&s=1683950966850&v=2.25.3:1
at Set.forEach (<anonymous>)
at xo.transition (WASubContext.js?t=wechat&s=1683950966850&v=2.25.3:1)
at Ia.<anonymous> (WASubContext.js?t=wechat&s=1683950966850&v=2.25.3:1)
at Generator.throw (<anonymous>)
at t (WASubContext.js?t=wechat&s=1683950966850&v=2.25.3:1)
at l (WASubContext.js?t=wechat&s=1683950966850&v=2.25.3:1)
没有官方人员解决吗?
怎么反馈到官方,我这也有这个问题,频繁报错:
watch closed Error: errCode: -402002 realtime listener init watch fail | errMsg: login fail Error: wsclient.send timedout
history states: UNINIT-(loginStart)->INIT_LOGGING_IN-(loginFail)->INIT_LOGIN_FAIL-(loginStart)->INIT_LOGGING_IN-(loginFail)->INIT_LOGIN_FAIL-(loginStart)->INIT_LOGGING_IN-(loginFail)->INIT_LOGIN_FAIL-(close)->CLOSED
at _FSMListener (WACloud.js:1)
at WACloud.js:1
at Set.forEach (<anonymous>)
at ma.transition (WACloud.js:1)
at hs.<anonymous> (WACloud.js:1)
at Iterator.throw (<anonymous>)
at t (WACloud.js:1)
at u (WACloud.js:1)
代码
// @ts-expect-error
this.combatWatcher = await combatModel.watch(id, watcherChange.bind(this), (e) => {
void this.closeCombatWatcher()
console.log(e)
toast.show('服务器连接超时,请重试' , 1200).finally(() => {
this.onBack()
})
})
},
return await new Promise((resolve) => {
const listener = this.model.doc(_id).watch({
onChange (snapshot) {
if (snapshot.type === 'init') {
resolve(listener)
}
onChange.call(this, snapshot)
},
onError
})
})
}