@masslessai/push-todo 3.4.8 → 3.4.9
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/lib/daemon.js +18 -1
- package/package.json +1 -1
package/lib/daemon.js
CHANGED
|
@@ -341,13 +341,30 @@ async function apiRequest(endpoint, options = {}, retry = true) {
|
|
|
341
341
|
async function fetchQueuedTasks() {
|
|
342
342
|
try {
|
|
343
343
|
const machineId = getMachineId();
|
|
344
|
+
const machineName = getMachineName();
|
|
344
345
|
const params = new URLSearchParams();
|
|
345
346
|
params.set('execution_status', 'queued');
|
|
346
347
|
if (machineId) {
|
|
347
348
|
params.set('machine_id', machineId);
|
|
348
349
|
}
|
|
349
350
|
|
|
350
|
-
|
|
351
|
+
// Get registered git_remotes for heartbeat tracking
|
|
352
|
+
// This enables iOS app to check if daemon is online for specific projects
|
|
353
|
+
const projects = getListedProjects();
|
|
354
|
+
const gitRemotes = Object.keys(projects);
|
|
355
|
+
|
|
356
|
+
// Add heartbeat headers for daemon status tracking
|
|
357
|
+
// See: /docs/20260204_daemon_heartbeat_status_indicator_implementation_plan.md
|
|
358
|
+
const heartbeatHeaders = {};
|
|
359
|
+
if (machineId && gitRemotes.length > 0) {
|
|
360
|
+
heartbeatHeaders['X-Machine-Id'] = machineId;
|
|
361
|
+
heartbeatHeaders['X-Machine-Name'] = machineName || 'Unknown Mac';
|
|
362
|
+
heartbeatHeaders['X-Git-Remotes'] = gitRemotes.join(',');
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
const response = await apiRequest(`synced-todos?${params}`, {
|
|
366
|
+
headers: heartbeatHeaders
|
|
367
|
+
});
|
|
351
368
|
|
|
352
369
|
if (!response.ok) {
|
|
353
370
|
if (response.status === 404) return [];
|