Repository navigation
fix: load pubky avatars up to 5 mb - #2252
Conversation
Pubky App accepts avatar uploads up to 5 MiB, but the image fetcher stopped at 1 MiB, so a 1.26 MB avatar never showed. Use one 5 MiB limit for displaying avatars and for moving a Bitkit avatar to pubky.app. Verified: ./gradlew :app:testDevDebugUnitTest --tests PubkyImageFetcherTest --tests PubkyRepoTest
Verified: none (docs only)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge. SummaryRaises Pubky avatar downloads from 1 MiB to 5 MiB.
No actionable issues found. Tests were not run during this review. Reviews (1) · Last reviewed commit: "docs: note the 5 mb pubky image limit" · Reviewed by Greptile |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Raises the Pubky image fetch cap from 1 MiB to 5 MiB, matching pubky.app's 5 MiB image upload limit, and reuses that constant for the Bitkit-to-pubky.app avatar move. Reviewed 8523e24, light tier (8 code lines), files read whole.
What I checked, and 4 candidates I ruled out
Read in full: PubkyImageFetcher.kt, the moveAvatar path in PubkyRepo.kt, ImageModule.kt, PubkyService.fetchFile
Call sites traced: every PUBKY_IMAGE_MAX_BYTES use (descriptor fetch, blob fetch, moveAvatar); no other image fetch keeps a 1 MiB cap
Limit checked: pubky.app's IMAGE_MAX_UPLOAD_SIZE = 5 * 1024 * 1024 (src/config/images.ts) equals 5_242_880uL
Build: not built here; Bitkit Android branches are reviewed from the code and CI on this box
CI: build-and-test, lint and compose-ui were still pending at review time
Ruled out
moveAvatarbehaviour change: the removedPUBKY_APP_AVATAR_MAX_BYTESwas already5_242_880uL, so the move path reads with the same cap as before.- Failures remembered from the old cap:
PubkyImageFailureCacheis in memory per factory, so aProtocolfailure recorded by the 1 MiB build does not survive the update's process restart. - Memory from larger bodies: Coil decodes to the requested size, so only the raw body grows, bounded at 5 MiB per in-flight fetch; avatars that size are the case this PR exists to load.
- New test meaningful: the stubs match only
5_242_880uL; with any other constant the unstubbed mock returns null and the fetch fails, so it pins the value.
Merge confidence: 4/5, no findings and the change is covered by PubkyImageFetcherTest.kt, held from 5 only because CI had not finished.
Reviewer model: Claude Opus 5.5
Reasoning effort: Not exposed (the review run's metadata does not report it)
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
coreyphillips
left a comment
There was a problem hiding this comment.
Two independent reviews, nothing blocking a merge.
|
Merged: approved by @coreyphillips on this head, required checks green, no open threads. |
Twin: synonymdev/bitkit-ios#1586
Source: qa, #2248
Description
response exceeds the 1048576-byte limit)Out of Scope
None.
Design
N/A — no UI changes.
Preview
N/A — no UI changes.
QA Notes
Setup
A Pubky identity whose profile avatar is between 1 MiB and 5 MiB (for example a 1024×1024 PNG exported from Pubky App).
Journeys
N/A — not drivable; see Manual Tests.
Manual Tests
Automated Checks
PubkyImageFetcherTest.kt— a descriptor and blob are fetched with the 5 MiB limitPubkyImageFetcherTest.kt,PubkyRepoTest.ktEvidence
Failed to fetch pubky image blob … response exceeds the 1048576-byte limitfor a 1,259,708-byte PNG avatar set in Pubky App.Gaps
Models used
Claude Opus 5.5(reasoning:medium)Claude Opus 5.5(reasoning:medium)Gemini 4 Neon(reasoning:high)