Skip to content

Add Firebase failure-type logging for upload failures - #1321

Open
brundamarpadaga wants to merge 3 commits into
Greenstand:masterfrom
brundamarpadaga:feature/upload-failure-logging
Open

Add Firebase failure-type logging for upload failures#1321
brundamarpadaga wants to merge 3 commits into
Greenstand:masterfrom
brundamarpadaga:feature/upload-failure-logging

Conversation

@brundamarpadaga

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request!

Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests are added/updated (if necessary)
  • Ensure the linter passes (./codeAnalysis to automatically apply formatting/linting)
  • Appropriate docs were updated (if necessary)

📸 Proof of change (REQUIRED)

Every PR must include a screen recording / video showing the change working.
UI changes must also include before/after screenshots.
Just drag-and-drop the files into the boxes below — GitHub will upload them.
PRs without the required media will be flagged automatically and cannot be merged.

🎥 Screen recording / video (always required)

🖼️ Screenshots (required for any UI change)

Before After
  • This change has no user-visible / UI effect (refactor, docs, CI, etc.), so screenshots are not applicable.
    • A maintainer may also apply the non-ui label. A video is still required even for non-UI changes.

Fixes #1317 🦕

@brundamarpadaga

Copy link
Copy Markdown
Contributor Author

This adds Firebase logging for upload failures per the issue: every failure path across TreeUploader, PlanterUploader, SessionUploader, DeviceConfigUploader, MessageUploader, and the image/location upload use cases now routes through a single ExceptionDataCollector.recordFailure() call, tagging each with a failure type (network_failure, parsing_failure, server_failure, unknown_failure).

One thing worth flagging: the issue asked for Crashlytics-style logging, but I also added a Firebase Analytics event (upload_failure with a failure_type param) alongside it. Crashlytics groups recorded exceptions by stack trace, so the same failure type thrown from different call sites doesn't give a clean aggregate count. Analytics gives a native "how often does each failure type happen" count, which is what the issue's goal section asks for. It wasn't explicitly requested, so calling it out in case you'd rather keep this Crashlytics-only.

I don't currently have access to the tree-tracker-a7a13 Firebase project, so I haven't been able to verify the events show up in Crashlytics/Analytics DebugView myself, so I only confirmed locally via Logcat that the correct failure type is recorded for real network/server errors. Do I need project access to verify this end-to-end, or does someone else typically confirm that before the merge?

@cynthiabondi
cynthiabondi requested a review from Elforama August 3, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Firebase logging to the upload process to categorize upload failures

1 participant