debug(push): add native push-setup telemetry to trace iOS registration
device_tokens stays empty after reinstall+Allow, so the APNs token is never obtained or never reaches the server, and there's no device console on Windows. Add a /api/push-debug collector and breadcrumbs through setupNativePush (plugin presence, permission state, register call, registration event/error, token POST result) so the failing step is visible in server logs. Temporary — remove once push is confirmed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -424,6 +424,18 @@ route('POST', '/api/devices/remove', async (req, res) => {
|
||||
json(res, 200, { ok: true });
|
||||
});
|
||||
|
||||
// --- Push diagnostics (temporary): the native app reports each step of push setup here so we can see
|
||||
// WHERE iOS registration fails without a Mac/device console. Best-effort; logs and returns 200. ---
|
||||
route('POST', '/api/push-debug', async (req, res) => {
|
||||
try {
|
||||
const b = await readBody(req);
|
||||
let uid = 'anon'; try { const u = await currentUser(req); if (u) uid = u.id; } catch (_) {}
|
||||
const line = (typeof b === 'object' ? JSON.stringify(b) : String(b)).slice(0, 800);
|
||||
console.log('[push-debug] user=' + uid + ' ' + line);
|
||||
} catch (_) {}
|
||||
json(res, 200, { ok: true });
|
||||
});
|
||||
|
||||
// --- App install telemetry: records each install and, once the user signs in, who's using it. ---
|
||||
route('POST', '/api/telemetry/install', async (req, res) => {
|
||||
const { installId, platform, appVersion, os } = await readBody(req);
|
||||
|
||||
Reference in New Issue
Block a user