Register the rider push-notification route

/utils/notifyuser has been commented out since the initial commit, so every
rider push the admin consoles have ever sent returned 404. Riders were
assigned deliveries and never told, and the failure surfaced as a generic
"notification failed" that read like a transient network fault.

Nothing else was missing. The handler, the FcmNotification model, the
Firebase service account and the Dockerfile line that copies that account
into the image were all already in place — only the route registration was
absent, which is why the gap survived this long.

Verified against Google: with the route registered, FCM authenticates the
service account and returns a specific rejection for a deliberately invalid
token rather than a 404. No push was sent to a real rider, so the final hop
to a device is still unproven.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 12:48:36 +05:30
parent c290e1729a
commit 481be667db

View File

@@ -11,7 +11,12 @@ func RegisterUtilsRoutes(api fiber.Router, f *facade.Facade) {
utils := api.Group("/v1/web/utils") utils := api.Group("/v1/web/utils")
utils.Get("/getapptypes", f.UtilsController.GetAppTypes) utils.Get("/getapptypes", f.UtilsController.GetAppTypes)
// utils.Post("/notifyuser", f.UtilsController.NotifyUser) // Commented out since the initial commit, which meant every rider push the
// admin console has ever sent returned 404 — riders were assigned deliveries
// and never told. The handler, the FcmNotification model, the Firebase
// service account and the Dockerfile COPY that puts it in the image were all
// already in place; only the route was missing.
utils.Post("/notifyuser", f.UtilsController.NotifyUser)
utils.Get("/getsubcategories", f.UtilsController.GetSubcategories) utils.Get("/getsubcategories", f.UtilsController.GetSubcategories)
utils.Get("/getapplocations", f.UtilsController.GetApplocations) utils.Get("/getapplocations", f.UtilsController.GetApplocations)
utils.Get("/getappcategories", f.UtilsController.GetAppCategory) utils.Get("/getappcategories", f.UtilsController.GetAppCategory)