我的也是开发过程中,时好时坏,上传正式,到现在没有出现问题,本地先保证程序无错误就行,后面持续关注一下。
小程序云开发,用watch监听数据,报-402002状态错误?[图片]
2023-05-23事件类型不对,应该选subscribe_and_unsubscribe
怎么实现公众服务号关注后,触发小程序云资源共享的云函数?现已将小程序云资源cloud1-cloud1-1g3f6e5v49b1fd78共享给同主体下公众服务号wx0d35c3d49587092a,并设置了云开发资源的消息推送云函数userinfo 想实现用户关注公众号wx0d35c3d49587092a后,自动触发共享的云函数userinfo,请提供可行方案,谢谢~ [图片] // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 云函数入口函数 exports.main = async (event, context) => { const wxContext = cloud.getWXContext() await cloud.openapi.customerServiceMessage.send({ touser: wxContext.OPENID, msgtype: 'event', }) return 'success' }
2023-05-18怎么反馈到官方,我这也有这个问题,频繁报错: 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)
watch一直报402002Error: 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)
2023-05-14彭兄,请问解决了吗?我也出现这个问题。不知道如何解决。
云开发使用watch监听,经常报402002异常,如何解决?我的小程序使用了watch监听函数,目前经常报错,报错概率非常高,影响了小程序用户的使用体验,麻烦给查一下一下吧 报异常时就是等待十多秒后报出异常。。。 我的APPID为:wxdaf4eb13f330c75b 异常截图: [图片] 代码片: this.messageListener = await roomModel.model.doc(roomId).watch({ onChange: handleWatch.bind(this), onError: e => { log.error(e) this.selectComponent('#errorMessage').show('服务器连接异常...', 2000, () => { router.reLaunch() }) } })
2023-05-14the watch closed because of error Error: errCode: -402004 realtime listener rebuild watch fail | errMsg: login fail Error: wsclient.send timedout history states: UNINIT-(loginStart)->INIT_LOGGING_IN-(loginSuccess)->INIT_LOGGED_IN-(initWatchStart)->INIT_WATCH_PENDING-(initWatchSuccess)->INIT_WATCH_SUCCESS-(wsDisconnected)->PAUSED-(loginStart)->REBUILD_LOGGING_IN-(loginFail)->REBUILD_LOGIN_FAIL-(loginStart)->REBUILD_LOGGING_IN-(loginFail)->REBUILD_LOGIN_FAIL-(loginStart)->REBUILD_LOGGING_IN-(loginFail)->REBUILD_LOGIN_FAIL-(close)->CLOSED 真机2.32也出现这个,请问怎么解决掉?
实时数据总是报错实时数据总是报以下错误. 是由于网络问题造成的吗? 有什么解法? Error: errCode: -402004 realtime listener rebuild watch fail | errMsg: Error: query event cache timeout (rebuildWatch requestId 1571124955751_0.4731700562044896) at new u (https://lib/WASubContext.js:1:100461) at o (https://lib/WASubContext.js:1:337252) at Object.onTimeoutError (https://lib/WASubContext.js:1:337759) at Ei.handleCommonError (https://lib/WASubContext.js:1:341546) at Ei.(https://lib/WASubContext.js:1:337642) at https://lib/WASubContext.js:1:96167 at Object.next (https://lib/WASubContext.js:1:96272) at https://lib/WASubContext.js:1:95210 at new Promise () at l (https://lib/WASubContext.js:1:94989) Error: errCode: -402002 realtime listener init watch fail | errMsg: Error: SIGN_EXPIRED_ERROR sign expired (initWatch requestId 1571582784623_0.7682918740646201) at new u (WASubContext.js:1:99266) at o (WASubContext.js:1:336057) at i (WASubContext.js:1:336437) at Ei.<anonymous> (WASubContext.js:1:337386) at WASubContext.js:1:94972 at Object.next (WASubContext.js:1:95077) at n (WASubContext.js:1:93848) Error: errCode: -402010 realtime listener check last fail | errMsg: Error: invalid state: ws connection not exists, can not send message at new u (WASubContext.js:1:99266) at Ei.<anonymous> (WASubContext.js:1:339824) at WASubContext.js:1:94972 at Object.throw (WASubContext.js:1:95077) at r (WASubContext.js:1:93899)
2023-05-13