server/metrics.ts exports metricsApiRoutes with seven handlers:
/collab-reconnect, /mark-anchor, /mirror-file-creation, /library-claim, /auth-challenge, /deep-link-unhandled, /offline-edit-merge
server/index.ts never mounts the router, so all seven are unreachable and every metric the browser bundle posts 404s. The visible one is /api/metrics/mark-anchor, which src/bridge/share-client.ts (reportMarkAnchorResolution) posts on each anchor resolution — it shows up as repeated 404s in the console.
app.use("/api/metrics", metricsApiRoutes);
Mounting it ahead of the /api compatibility gate seems right: these are fire-and-forget posts from the bundle rather than versioned client API calls, and enforceApiClientCompatibility rejects them with 426 for a missing x-proof-client-build.
Verified locally — with the mount, the real client payload {"result":"success","source":"web"} returns {"success":true}; without it, 404.
Happy to send a PR.
server/metrics.tsexportsmetricsApiRouteswith seven handlers:/collab-reconnect,/mark-anchor,/mirror-file-creation,/library-claim,/auth-challenge,/deep-link-unhandled,/offline-edit-mergeserver/index.tsnever mounts the router, so all seven are unreachable and every metric the browser bundle posts 404s. The visible one is/api/metrics/mark-anchor, whichsrc/bridge/share-client.ts(reportMarkAnchorResolution) posts on each anchor resolution — it shows up as repeated 404s in the console.Mounting it ahead of the
/apicompatibility gate seems right: these are fire-and-forget posts from the bundle rather than versioned client API calls, andenforceApiClientCompatibilityrejects them with 426 for a missingx-proof-client-build.Verified locally — with the mount, the real client payload
{"result":"success","source":"web"}returns{"success":true}; without it, 404.Happy to send a PR.