Repository navigation
fix(blob): stop AndroidUploadImageCache.uploadMimeFor recursing into itself - #1979
Merged
Merged
Conversation
…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.
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.
Every Android image upload through
ImageUploadPreparer.preparecrashes withStackOverflowErroron 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.uploadMimeForwas meant to delegate to the imported top-levelcom.getcode.util.resources.uploadMimeFor. Inside the class, the unqualified call resolves to the member through the implicitthisreceiver before the import, so the method calls itself. All 200 frames in the Bugsnag stack areAndroidUploadImageCache.kt:16. It came in with #1923, and existing tests use fake caches, so nothing exercised the Android implementation.contentUploadMimeForand call that.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.