Skip to content

fix(blob): stop AndroidUploadImageCache.uploadMimeFor recursing into itself - #1979

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/upload-mime-recursion
Nov 8, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/upload-mime-recursion

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Every Android image upload through ImageUploadPreparer.prepare crashes with StackOverflowError on 2026.11.1 (Bugsnag 6aeb935f0f9ccb2e94314ff5, 9 events / 3 users since Nov 4). That covers profile photo, group picture, group cover and create-group photo.

AndroidUploadImageCache.uploadMimeFor was meant to delegate to the imported top-level com.getcode.util.resources.uploadMimeFor. Inside the class, the unqualified call resolves to the member through the implicit this receiver before the import, so the method calls itself. All 200 frames in the Bugsnag stack are AndroidUploadImageCache.kt:16. It came in with #1923, and existing tests use fake caches, so nothing exercised the Android implementation.

  • Import the top-level function as contentUploadMimeFor and call that.
  • Add AndroidUploadImageCacheTest (Robolectric) against the real cache: JPEG stays JPEG, HEIC and unknown types map to PNG. All three cases fail without the fix.

This needs to go out as a 2026.11.1 hotfix as well; that will be a separate cherry-pick onto a hotfix branch.

…itself

The override delegated to the imported top-level uploadMimeFor, but inside
the class the unqualified call resolved to the member, so every image upload
through ImageUploadPreparer.prepare overflowed the stack. That breaks profile
photo, group picture, group cover and create-group photo uploads on Android
since #1923.

Import the top-level function under an alias, and cover the real Android
cache with a Robolectric test.
@bmc08gt bmc08gt self-assigned this Nov 8, 2026
@github-actions github-actions Bot added the type: fix Bug fix label Nov 8, 2026
@bmc08gt
bmc08gt merged commit 3d64177 into code/cash Nov 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant