Skip to content

Guard and diagnose profile photo uploads - #482

Merged
Muawiya-contact merged 12 commits into
developfrom
codex/457-photo-upload-timeout-diagnostics
Nov 4, 2026
Merged

Muawiya-contact merged 12 commits into
developfrom
codex/457-photo-upload-timeout-diagnostics

Conversation

@Muawiya-contact

@Muawiya-contact Muawiya-contact commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Root cause and recovery

Production photo saves still failed on v1.10.18 after the client preparation fixes. A read-only production query found no profile-avatars Storage bucket. The owner created the bucket in the production Supabase project, then verified that both a gallery photo and a camera photo save and appear in Profile; an uploaded object is visible in Storage. A second query confirmed the bucket is private, its size limit is 262144 bytes, and its allowlist is image/jpeg, image/png, and image/webp.

Changes

  • Give only the bounded photo PUT a 60-second request deadline to allow a cold Edge image worker to start. Other requests retain the 15-second default.
  • Distinguish a timed-out photo upload from a transport failure, without marking a timed-out request as proof of lost device connectivity.
  • Keep an avatar-only Storage 503 from applying a global client cooldown to unrelated lesson requests.
  • Preserve the original AbortError for ordinary 15-second requests; only the explicitly extended photo upload gets the new timeout classification.
  • Return a generic 503 with an incident ID when Edge image normalization or Storage upload fails; the Edge log records a safe category and upstream status without photo bytes, account data, or credentials.
  • Make the protected production deploy fail before publishing Edge code if the private profile-avatars bucket or its 256 KiB JPEG/PNG/WebP settings are missing. This read-only check prevents the manual Storage setup from being silently skipped again.
  • Print profile_avatar_bucket=missing separately from schema readiness when the deploy guard fails, so the operator sees the actionable missing setup.
  • Update the avatar runbook and work log with the confirmed cause and device retest.

Validation

  • Mobile TypeScript and focused timeout/API-client tests passed, including the 503 isolation regression.
  • Edge TypeScript and avatar/handler tests passed.
  • Python syntax and git diff --check passed.
  • The owner's production Android app successfully saved both gallery and camera photos after creating the bucket. These new PR code changes are not yet deployed, so the extended deadline and incident categories have local/CI coverage but no live-device verification.

No SQL migration, Cron change, new APK, OTA, or production deployment is included. Merge into develop only after review; a later release will carry the code to production. The manual bucket repair is already live.

Closes #457

@Muawiya-contact
Muawiya-contact marked this pull request as ready for review November 4, 2026 16:43
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-04T16:43:17.103568Z
We couldn’t complete this review. Comment @codex review to try again.
ac37569 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Muawiya-contact Muawiya-contact left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Muawiya-contact
Muawiya-contact merged commit abbcccb into develop Nov 4, 2026
4 checks passed
@Muawiya-contact
Muawiya-contact deleted the codex/457-photo-upload-timeout-diagnostics branch November 4, 2026 17:00
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.

Fix profile photo uploads from gallery and camera

1 participant