eufy-security-client 4.1.0-dev.36 → 4.1.0-dev.38
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/build/eufysecurity.js +24 -8
- package/build/eufysecurity.js.map +1 -1
- package/coverage/clover.xml +914 -909
- package/coverage/coverage-final.json +2 -2
- package/coverage/lcov-report/index.html +15 -15
- package/coverage/lcov.info +1924 -1918
- package/package.json +1 -1
package/build/eufysecurity.js
CHANGED
|
@@ -287,14 +287,30 @@ class EufySecurity extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
287
287
|
this.api.setSerialNumber(this.persistentData.serial_number);
|
|
288
288
|
this.pushService = await service_1.PushNotificationService.initialize();
|
|
289
289
|
this.pushService.on("connect", async (token) => {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
//
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
290
|
+
// Register the SAME FCM token on BOTH backends, INDEPENDENTLY. A migrated account is rejected
|
|
291
|
+
// by the legacy endpoint; a non-migrated one has no mega session. Whichever backend accepts the
|
|
292
|
+
// token delivers events — so one failing must never starve the other, and push counts as
|
|
293
|
+
// established if EITHER side accepted it.
|
|
294
|
+
let legacyOk = false;
|
|
295
|
+
try {
|
|
296
|
+
legacyOk = await this.api.registerPushToken(token);
|
|
297
|
+
legacyOk = legacyOk && (await this.api.checkPushToken());
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
logging_1.rootMainLogger.warn("Legacy push token registration failed (v6 may still deliver)", {
|
|
301
|
+
error: (0, utils_1.getError)((0, error_1.ensureError)(err)),
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
this.pushCloudRegistered = legacyOk;
|
|
305
|
+
this.pushCloudChecked = legacyOk;
|
|
306
|
+
// Adjust this call to match your build: inline it's this.registerMegaPushToken(token);
|
|
307
|
+
// after the refactor it's likely this.megaTransition.registerMegaPushToken(token).
|
|
308
|
+
const megaOk = await this.megaTransition.registerMegaPushToken(token); // must return boolean, best-effort, never throws
|
|
309
|
+
if (legacyOk || megaOk) {
|
|
310
|
+
logging_1.rootMainLogger.info("Push notification connection successfully established", {
|
|
311
|
+
legacy: legacyOk,
|
|
312
|
+
eufyMega: megaOk,
|
|
313
|
+
});
|
|
298
314
|
this.emit("push connect");
|
|
299
315
|
}
|
|
300
316
|
else {
|