chore: log Cloud push gateway response on accepted (200) pushes#41572
chore: log Cloud push gateway response on accepted (200) pushes#41572Nahid-NHB wants to merge 1 commit into
Conversation
Push notifications sent through the Cloud push gateway (gateway.rocket.chat) that return a successful HTTP status were never logged, so operators had no visibility into the gateway's response body when troubleshooting delivery issues (gateway accepts a push but it never reaches FCM/APNs). This adds a debug-level log of the service, response status, and response body on the success path, matching the existing log calls already in place for the 406/422/401 branches.
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: d29ac43 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
**/*.spec.ts📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (6)📚 Learning: 2026-03-16T21:50:37.589ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-05-06T12:21:44.083ZApplied to files:
📚 Learning: 2026-02-24T19:22:48.358ZApplied to files:
📚 Learning: 2026-03-06T18:10:15.268ZApplied to files:
🔇 Additional comments (5)
WalkthroughThe Cloud push gateway now logs successful response status and body details at debug level. Unit tests stub the gateway request, verify the log output for an HTTP 200 response, and add a patch changeset entry. ChangesPush gateway response logging
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Proposed changes (including videos or screenshots)
When a push is sent through the Cloud push gateway (
gateway.rocket.chat),sendGatewayPushalready logs on the 406, 422 and 401 branches, but the success path (result.ok) just returns silently. That means once the gateway accepts a push, the server has zero record of what it actually returned, only that the HTTP call didn't error out.This showed up clearly in #41569: the gateway was returning 200 with an empty body for every push, and the only way the reporter could see that was by putting a transparent proxy in front of the gateway and capturing raw responses by hand. That's not something we should be asking self-hosted admins to do to get basic visibility into their own push pipeline.
This PR adds a single debug-level log line on the success path with the service (
apn/gcm), status code and response body, mirroring the log calls already used for the other branches. It doesn't change any behavior, just makes the existing "black box" 200 response visible in logs (LOG_LEVEL=debug) so admins/support can tell at a glance whether the gateway is actually echoing anything useful back, instead of having to intercept traffic themselves.Worth noting: this doesn't fix delivery for the workspace in #41569. I dug through the gateway request/payload code in this repo (
push.ts,apn.ts, thePush_productionsetting) and found nothing wrong on the client side, no missing fields, no recent regression. The gateway consistently accepting (200) but never delivering to FCM/APNs for one specific workspace looks like a server-side issue on the Cloud gateway (credential provisioning for that workspace, most likely), which lives outside this repo. This is a small, self-contained improvement to make that class of problem diagnosable from server logs going forward.Issue(s)
Related to #41569
Steps to test or reproduce
Push_enable,Push_enable_gateway) withLOG_LEVEL=debug.push sent to gatewaydebug entry containingservice,statusandresponse.Unit test added:
apps/meteor/tests/unit/server/lib/notifications/push/push.spec.ts(sendGatewayPush()suite), covering the new log call.Further comments
Considered forwarding this info back to the client/API response instead, but that's unnecessary. This is purely an operator-facing diagnostic, so a debug log is the right scope, no API or behavior changes.
Summary by CodeRabbit
Improvements
Tests