fix: isolate invalid patch bundle import failures#3329
Open
mostafaNazari702 wants to merge 1 commit into
Open
Conversation
oSumAtrIX
reviewed
May 2, 2026
| private fun PatchBundle.loadPatchSet(): Set<Patch> { | ||
| val file = File(patchesJar) | ||
| file.requireDexContainer() | ||
|
|
Member
There was a problem hiding this comment.
Do we need explicit checks like this or should we just raise the original exceptions? @Axelen123
Contributor
|
If I remember correctly, this stuff was going to be implemented in patcher instead. |
Member
|
Yep and it was already, found in dev branch |
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.
The cause of the bug was that a local patch file was dropped into the patch source folder and then picked up by the normal pipeline that loads all patch bundles together.
The problem started when an invalid file made it to the android patch loader.
Patch.androidKt.loadPatchestried to read it as a dex file usingMultiDexIO.readDexFilebut it wasn’t actually a dex file, so it crashed before it could clearly identify where the bad input came from. After that,PatchBundleRepository.loadMetadatatreated the whole batch as failed, marked all patch sources as broken, and returned no metadata at all. since that metadata is also used to decide which apps are compatible and should be shown, one bad file ended up making the whole default bundle look broken. which caused the entire "Apps" section to disappear until the invalid file was removed.