diag: error_log sync-event POSTs to trace missing toasts
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) <noreply@anthropic.com>
This commit is contained in:
1 parent
4a668b7fc4
commit
6cd00f9660
4 files changed
+12
-4
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
define('APP_NAME', 'hyprcrd');
|
define('APP_NAME', 'hyprcrd');
|
||||||
define('APP_VERSION', '1.8.1');
|
define('APP_VERSION', '1.8.2');
|
||||||
|
|
||||||
// Database path — writable directory, outside webroot
|
// Database path — writable directory, outside webroot
|
||||||
// DB_PATH / UPLOAD_DIR can be pre-defined by the Electron router for app isolation
|
// DB_PATH / UPLOAD_DIR can be pre-defined by the Electron router for app isolation
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hyprcrd",
|
"name": "hyprcrd",
|
||||||
"version": "1.8.1",
|
"version": "1.8.2",
|
||||||
"description": "hyprcrd — self-hosted card manager",
|
"description": "hyprcrd — self-hosted card manager",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+5
-1
@@ -910,8 +910,12 @@ if (str_starts_with($route, '/api/')) {
|
|||||||
],
|
],
|
||||||
CURLOPT_TIMEOUT => 5,
|
CURLOPT_TIMEOUT => 5,
|
||||||
]);
|
]);
|
||||||
curl_exec($bch);
|
$bRes = curl_exec($bch);
|
||||||
|
$bStat = curl_getinfo($bch, CURLINFO_HTTP_CODE);
|
||||||
curl_close($bch);
|
curl_close($bch);
|
||||||
|
@error_log('[hyprcrd] sync-event POST → ' . $senderName
|
||||||
|
. ' status=' . $bStat
|
||||||
|
. ' body=' . substr((string)$bRes, 0, 120));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download attachments
|
// Download attachments
|
||||||
|
|||||||
@@ -707,10 +707,14 @@ function collabSyncCards(PDO $db): array {
|
|||||||
// authored by someone else.
|
// authored by someone else.
|
||||||
if ($foreignAuthor && !empty($c['author_username'])) {
|
if ($foreignAuthor && !empty($c['author_username'])) {
|
||||||
$cardTitle = trim((string)($fields['title'] ?? '')) ?: '(untitled)';
|
$cardTitle = trim((string)($fields['title'] ?? '')) ?: '(untitled)';
|
||||||
collabRelayCall('/api/sync-events', 'POST', [
|
$evRes = collabRelayCall('/api/sync-events', 'POST', [
|
||||||
'recipient' => $c['author_username'],
|
'recipient' => $c['author_username'],
|
||||||
'body' => $selfUser . ' synced: ' . $cardTitle,
|
'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));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user