usebeeline 0.0.69 → 0.0.71
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/dist/usebeeline.mjs +9 -3
- package/package.json +1 -1
package/dist/usebeeline.mjs
CHANGED
|
@@ -18057,6 +18057,7 @@ async function runServerCommandIntake(options) {
|
|
|
18057
18057
|
throw new Error("server command protocol 1 is required; refusing intake");
|
|
18058
18058
|
let busy;
|
|
18059
18059
|
let wake;
|
|
18060
|
+
let pushIntakeAcknowledged = false;
|
|
18060
18061
|
const pending = new Map(first.commands.map((command) => [command.id, command]));
|
|
18061
18062
|
const claimed = /* @__PURE__ */ new Set();
|
|
18062
18063
|
const notify2 = (commands = []) => {
|
|
@@ -18066,9 +18067,14 @@ async function runServerCommandIntake(options) {
|
|
|
18066
18067
|
wake?.(false);
|
|
18067
18068
|
};
|
|
18068
18069
|
options.onWake?.(notify2);
|
|
18069
|
-
const off = api.liveSubscribe?.(roomId, void 0, void 0, (connected) => {
|
|
18070
|
-
|
|
18070
|
+
const off = api.liveSubscribe?.(roomId, void 0, void 0, (connected, capabilities) => {
|
|
18071
|
+
const acknowledged = connected && capabilities?.pushIntake === true;
|
|
18072
|
+
if (pushIntakeAcknowledged !== acknowledged) {
|
|
18073
|
+
pushIntakeAcknowledged = acknowledged;
|
|
18074
|
+
wake?.(!connected);
|
|
18075
|
+
} else if (!connected) {
|
|
18071
18076
|
wake?.(true);
|
|
18077
|
+
}
|
|
18072
18078
|
}, options.presence, notify2);
|
|
18073
18079
|
try {
|
|
18074
18080
|
while (!signal?.aborted) {
|
|
@@ -18120,7 +18126,7 @@ async function runServerCommandIntake(options) {
|
|
|
18120
18126
|
};
|
|
18121
18127
|
const aborted = () => done(false);
|
|
18122
18128
|
wake = done;
|
|
18123
|
-
const timer = setTimeout(() => done(true), options.pollMs ?? 1e3);
|
|
18129
|
+
const timer = setTimeout(() => done(true), pushIntakeAcknowledged ? 6e4 : options.pollMs ?? 1e3);
|
|
18124
18130
|
signal?.addEventListener("abort", aborted, { once: true });
|
|
18125
18131
|
if (pending.size && !busy)
|
|
18126
18132
|
done(false);
|