From 6cd00f966011467b73a52d72179866da23fafb40 Mon Sep 17 00:00:00 2001
From: th
Date: Tue, 14 Apr 2026 23:24:35 +0200
Subject: [PATCH] diag: error_log sync-event POSTs to trace missing toasts
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Temporary diagnostic scaffolding — B-side logs every POST to the relay
(status + body snippet), A-side already console.debugs the GET result
via sync_debug. Lets us narrow down where the sender-side toast gets
lost.
Co-Authored-By: Claude Opus 4.6 (1M context)
---
config.php | 2 +-
electron/package.json | 2 +-
public/index.php | 6 +++++-
public/plugins/collab-buckets/backend.php | 6 +++++-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/config.php b/config.php
index 9946605..7830864 100644
--- a/config.php
+++ b/config.php
@@ -1,7 +1,7 @@
5,
]);
- curl_exec($bch);
+ $bRes = curl_exec($bch);
+ $bStat = curl_getinfo($bch, CURLINFO_HTTP_CODE);
curl_close($bch);
+ @error_log('[hyprcrd] sync-event POST → ' . $senderName
+ . ' status=' . $bStat
+ . ' body=' . substr((string)$bRes, 0, 120));
}
// Download attachments
diff --git a/public/plugins/collab-buckets/backend.php b/public/plugins/collab-buckets/backend.php
index 6a6e051..3dbf9ef 100644
--- a/public/plugins/collab-buckets/backend.php
+++ b/public/plugins/collab-buckets/backend.php
@@ -707,10 +707,14 @@ function collabSyncCards(PDO $db): array {
// authored by someone else.
if ($foreignAuthor && !empty($c['author_username'])) {
$cardTitle = trim((string)($fields['title'] ?? '')) ?: '(untitled)';
- collabRelayCall('/api/sync-events', 'POST', [
+ $evRes = collabRelayCall('/api/sync-events', 'POST', [
'recipient' => $c['author_username'],
'body' => $selfUser . ' synced: ' . $cardTitle,
]);
+ @error_log('[hyprcrd] sync-event POST → ' . $c['author_username']
+ . ' ok=' . ($evRes['ok'] ?? 'n/a')
+ . ' status=' . ($evRes['status'] ?? '-')
+ . ' err=' . substr((string)($evRes['error'] ?? ''), 0, 120));
}
}
|