@jhh96/light-app-bridge 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -400,6 +400,11 @@ export default class LightAppBridge {
400
400
  this._connectStarted = true;
401
401
  // 等监听后端绑定完成后再握手,避免对端的 ack/hello 在监听绑定前到达而丢失
402
402
  const listenerReady = (_a = this._listenerReady) !== null && _a !== void 0 ? _a : Promise.resolve();
403
+ // dynamic 目标轮询在「发起握手时」即启动(幂等),不等握手成功——
404
+ // 插件在未集成 SDK 的轻应用上打开时握手必超时,若轮询依赖 _onConnected
405
+ // 则永远不启动,此后切到集成 SDK 的窗口也不会跟随迁移(实测卡死旧目标)。
406
+ // 轮询独立于连接状态:探测到新目标 ack 即 _rebindTo 建立连接。
407
+ this._startDynamicPoll();
403
408
  // 握手超时保护:仅插件(主动方)需要——它发了 hello 却收不到 ack 说明对端异常。
404
409
  // 轻应用(被动方)持续等待,不超时:插件可能任意晚才发起连接。
405
410
  if (this.role === 'plugin') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jhh96/light-app-bridge",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "type": "module",
5
5
  "description": "招商随行(WorkLink)插件窗口(plugin)与轻应用窗口(lightapp)之间的双向通信 SDK",
6
6
  "main": "./dist/index.js",