@dongdev/fca-unofficial 2.0.26 → 2.0.27

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.
package/CHANGELOG.md CHANGED
@@ -113,3 +113,6 @@ Too lazy to write changelog, sorry! (will write changelog in the next release, t
113
113
 
114
114
  ## v2.0.25 - 2025-10-12
115
115
  - Hotfix / auto bump
116
+
117
+ ## v2.0.26 - 2025-10-16
118
+ - Hotfix / auto bump
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongdev/fca-unofficial",
3
- "version": "2.0.26",
3
+ "version": "2.0.27",
4
4
  "description": "Unofficial Facebook Chat API for Node.js - Interact with Facebook Messenger programmatically",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,7 +4,7 @@ const uuid = require("uuid");
4
4
  "use strict";
5
5
  module.exports = function createListenMqtt(deps) {
6
6
  const { WebSocket, mqtt, HttpsProxyAgent, buildStream, buildProxy,
7
- topics, parseDelta, getTaskResponseData, logger
7
+ topics, parseDelta, getTaskResponseData, logger, emitAuth
8
8
  } = deps;
9
9
 
10
10
  return function listenMqtt(defaultFuncs, api, ctx, globalCallback) {
@@ -14,9 +14,12 @@ const markDelivery = require("./core/markDelivery");
14
14
  const getTaskResponseData = require("./core/getTaskResponseData");
15
15
  const createEmitAuth = require("./core/emitAuth");
16
16
  const parseDelta = createParseDelta({ markDelivery, parseAndCheckLogin });
17
- const listenMqtt = createListenMqtt({ WebSocket, mqtt, HttpsProxyAgent, buildStream, buildProxy, topics, parseDelta, getTaskResponseData, logger });
18
- const getSeqIDFactory = createGetSeqID({ parseAndCheckLogin, listenMqtt, logger });
17
+ // Create emitAuth first so it can be injected into both factories
19
18
  const emitAuth = createEmitAuth({ logger });
19
+ // Pass emitAuth into connectMqtt so errors there can signal auth state
20
+ const listenMqtt = createListenMqtt({ WebSocket, mqtt, HttpsProxyAgent, buildStream, buildProxy, topics, parseDelta, getTaskResponseData, logger, emitAuth });
21
+ // Inject emitAuth into getSeqID so its catch handler can notify properly
22
+ const getSeqIDFactory = createGetSeqID({ parseAndCheckLogin, listenMqtt, logger, emitAuth });
20
23
 
21
24
  const MQTT_DEFAULTS = { cycleMs: 60 * 60 * 1000, reconnectDelayMs: 2000, autoReconnect: true, reconnectAfterStop: false };
22
25
  function mqttConf(ctx, overrides) {