Skip to content

Commit dd53600

Browse files
chopperbrianoclaude
andcommitted
PSP keepalive: stop scaring users with the expected error response (win.21)
mctrivia's /keepalive endpoint always returns {"error":"unsubscribe failed will time out anyways"} even on successful keepalives that result in payments. Confirmed by direct curl from a working Linux node. The verbose diagnostic logging we added during win.14-16 debugging is now shipping noise: every 20 minutes the user sees a CRITICAL-looking "RESPONSE: {error: ...}" line that's actually fine. - Recognise the known-OK response substring and treat it as success; log "Reported online to ipfs.digiassetx.com" at INFO - Anything else from the server gets a "UNEXPECTED response" warning so a real outage actually surfaces - Demote the URL, body string, and raw response logs to DEBUG level (only visible after pressing [L] in the dashboard) — they include the secret code so they should never have been at INFO Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 28a3a96 commit dd53600

2 files changed

Lines changed: 25 additions & 15 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ SET(PATCH_VERSION 0)
4040
SET(SO_VERSION 0)
4141

4242
# Windows port build number (increment for each Windows-specific release)
43-
SET(WIN_BUILD 20)
43+
SET(WIN_BUILD 21)
4444

4545
# Add source directory
4646
include_directories(src)

src/PermanentStoragePool/pools/mctrivia.cpp

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -248,19 +248,14 @@ void mctrivia::_callServer(ServerCalls command, const string& extra) {
248248
string url = "https://ipfs.digiassetx.com/" + commandStr;
249249
if (!extra.empty()) url += "/" + extra;
250250

251-
// Log the full request details
251+
// Diagnostic detail at DEBUG level only — visible after pressing [L] in the
252+
// dashboard. Includes the secret, so we never want it at INFO.
252253
if (command == KEEP_ALIVE) {
253-
log->addMessage("PSP keepalive REQUEST: url=" + url, Log::INFO);
254-
log->addMessage("PSP keepalive REQUEST: address=" + address + " peerId=" + peerId +
255-
" visible=" + (_visible ? "v" : "h") + " secret=" + _secretCode, Log::INFO);
256-
}
257-
258-
// Build the exact body string for debug logging
259-
std::string body = "address=" + address + "&peerId=" + peerId +
260-
"&visible=" + (_visible ? std::string("v") : std::string("h")) +
261-
"&secret=" + _secretCode;
262-
if (command == KEEP_ALIVE) {
263-
log->addMessage("PSP keepalive REQUEST body: " + body, Log::INFO);
254+
log->addMessage("PSP keepalive REQUEST: url=" + url, Log::DEBUG);
255+
log->addMessage("PSP keepalive REQUEST body: address=" + address +
256+
"&peerId=" + peerId +
257+
"&visible=" + (_visible ? std::string("v") : std::string("h")) +
258+
"&secret=" + _secretCode, Log::DEBUG);
264259
}
265260

266261
std::string response;
@@ -277,8 +272,23 @@ void mctrivia::_callServer(ServerCalls command, const string& extra) {
277272
}
278273

279274
if (command == KEEP_ALIVE) {
280-
log->addMessage("PSP keepalive RESPONSE: " + response, Log::INFO);
281-
log->addMessage("Reported online to ipfs.digiassetx.com with server id: " + peerId);
275+
// The server's `keepalive` endpoint always returns
276+
// {"error":"unsubscribe failed will time out anyways"}
277+
// for both successful and unsuccessful keepalives — confirmed by direct
278+
// curl from a working Linux node that DOES receive payments. The text
279+
// is misleading; treat it as the expected OK response and only flag
280+
// anything else as an actual problem.
281+
const std::string expectedOk = "unsubscribe failed will time out anyways";
282+
bool responseOk = (response.find(expectedOk) != std::string::npos);
283+
284+
log->addMessage("PSP keepalive RESPONSE: " + response, Log::DEBUG);
285+
if (responseOk) {
286+
log->addMessage("Reported online to ipfs.digiassetx.com (server id: " +
287+
peerId + ")");
288+
} else {
289+
log->addMessage("PSP keepalive returned UNEXPECTED response: " + response,
290+
Log::WARNING);
291+
}
282292
}
283293

284294
//update the bad list

0 commit comments

Comments
 (0)