nightytidy 0.3.3 → 0.3.4
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/package.json +1 -1
- package/src/agent/index.js +12 -0
package/package.json
CHANGED
package/src/agent/index.js
CHANGED
|
@@ -1151,6 +1151,18 @@ export async function startAgent() {
|
|
|
1151
1151
|
releaseKeepAwake();
|
|
1152
1152
|
stopIdleHeartbeat();
|
|
1153
1153
|
saveInterruptedState();
|
|
1154
|
+
|
|
1155
|
+
// Notify Firestore immediately so the web app shows "Offline" without waiting
|
|
1156
|
+
if (firebaseAuth.isAuthenticated()) {
|
|
1157
|
+
try {
|
|
1158
|
+
await webhookDispatcher.dispatch('agent_offline', {}, [{
|
|
1159
|
+
url: FIREBASE_WEBHOOK_URL,
|
|
1160
|
+
label: 'nightytidy.com',
|
|
1161
|
+
headers: firebaseAuth.getAuthHeader(),
|
|
1162
|
+
}]);
|
|
1163
|
+
} catch { /* best effort — don't block shutdown */ }
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1154
1166
|
poller.stop();
|
|
1155
1167
|
scheduler.stopAll();
|
|
1156
1168
|
await wsServer.stop();
|