Add diagnostic logging to in-app support form submission#4414
Draft
joashrajin wants to merge 1 commit into
Draft
Add diagnostic logging to in-app support form submission#4414joashrajin wants to merge 1 commit into
joashrajin wants to merge 1 commit into
Conversation
The in-app support form ("Profile > Help & Feedback > Contact Support")
shows "Oops something went wrong" when submission fails, but the submit
code path emits zero log entries — HTTP status, response body, and
URLError details are all discarded before the alert fires. That makes
customer-reported failures (PCIOS-686) impossible to diagnose from
exported logs.
This change is strictly additive diagnostics:
- ZendeskSupportService: log POST URL, HTTP status, response body excerpt
(≤256 bytes), and URLError details on failure. Enrich serverError with
the status code and body excerpt.
- MessageSupportViewModel: log submit attempts, the recursive retry
trigger, and the final user-visible failure.
Retry behavior, alert copy, and the public API surface used by views are
unchanged.
Refs: PCIOS-686
Collaborator
Generated by 🚫 Danger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs PCIOS-686
The in-app Support form (Profile → Help & Feedback → Contact Support) shows the "Oops something went wrong" alert when both submit attempts fail. The submit code path currently emits zero log entries — HTTP status, response body, and
URLErrordetails are all discarded before the alert fires. Customer-reported failures (e.g. Zendesk #11265549, #11173685) are therefore impossible to diagnose from exported logs.This PR is strictly additive diagnostics. Retry behaviour, alert copy, and the public API used by views are unchanged.
Changes
ZendeskSupportServiceimport PocketCastsUtilsforFileLogbaseURL/newBaseURLlabel)URLErrorcode + description on transport failuresSupportRequestError.serverErrorto carrystatusCodeandbodyExcerpt; add.invalidResponsefor non-HTTPURLResponseMessageSupportViewModelsubmitRequestentry (withisRetryingflag)Why this matters
Today, when a customer reports "submit failed", we have nothing actionable — no status code to tell auth/rate-limit/server-down apart, no body to surface a Zendesk validation message, no signal whether both URLs failed or just one. After this change, a single exported log file pinpoints which Zendesk endpoint failed and why.
To test
ZendeskSupportService: POST https://… (baseURL)ZendeskSupportService: baseURL submit succeeded — HTTP 201(or similar)baseURLandnewBaseURLat an invalid host (in the relevantZDConfig), submit again, and confirm:MessageSupportViewModel: submitRequest — isRetrying: false, …ZendeskSupportService: baseURL submit failed — …MessageSupportViewModel: submit failed on first attempt — retrying via newBaseURL. …MessageSupportViewModel: submit failed after retry — surfacing error: …Checklist
CHANGELOG.mdif necessary. (Diagnostic-only — not user-facing; CHANGELOG entry skipped.)ZendeskSupportService; the behaviour change is purely logging output.)