Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Log push send failures instead of swallowing them silently

Duarte Santos7dea9ccfcc68
diff --git a/api/server.js b/api/server.js
index e442b5fef..e9d6de960 100644
--- a/api/server.js
+++ b/api/server.js
@@ -58,6 +58,7 @@ async function sendPush(userId, payload) {
await Promise.all(subs.map(async sub => {
try { await webpush.sendNotification({ endpoint: sub.endpoint, keys: sub.keys }, body); }
catch (e) {
+ console.error('push send failed', userId, e.statusCode, e.body || e.message);
if (e.statusCode === 404 || e.statusCode === 410) {
db.subs = db.subs.filter(s => s.endpoint !== sub.endpoint); dirty = true;
}