#Patch is downloaded, but installation is being skipped.

1 messages · Page 1 of 1 (latest)

pliant dust
#

Hi

I am facing an issue with patch installation on Android. In the logs I can see that the patch is being downloaded, when I switch to the beta track, but is not installing after restarting my app.

Sharing the logs attached.

Kindly help.

flutter: 3.38.5
Shorebird version: 1.6.75

pliant dust
#

I tried to debug a bit more and found:

  1. The patch is actually getting installed, but the ShorebirdUpdater.readCurrentPatch()is giving null in return. Hence the number of the current patch is not being displayed correctly.

  2. When I switch from beta to stable version, the patch that was installed on beta track is still active and running on the stable track. My expectation is that once the track is switched, the patch from different track should not be active.

pliant dust
#

More findings:

Same issue is replicated on latest versions as well:

HEAD is now at 110248879 chore: roll engine to 50b8af000ba26227acfba511ab40d9199c102625
Shorebird Engine • revision 50b8af000ba26227acfba511ab40d9199c102625
Flutter 3.38.7 • channel [user-branch] • unknown source
Framework • revision 1102488790 (5 days ago) • 2026-01-23 17:40:51 -0800
Engine • hash f76ef242766d65efe2ddcd9d09ab5fea6a964690 (revision 50b8af000b) (5 days ago) • 2026-01-23 23:30:24.000Z
Tools • Dart 3.10.7 • DevTools 2.51.1
Building Shorebird...
Resolving dependencies in `/Users/neelanshsethi/.shorebird`... 
Downloading packages... 
Got dependencies in `/Users/neelanshsethi/.shorebird`.
Shorebird 1.6.78 • [email protected]:shorebirdtech/shorebird.git
Flutter 3.38.7 • revision 1102488790c5aaedda2e21d5f666792f09f76368
Engine • revision 50b8af000ba26227acfba511ab40d9199c102625
spice cedar
#

@viscid island can you please take a look here? All my normal debugging tricks from looking at our admin side of things is coming up short.

viscid island
#

Looking

#

So re: 2. I don't think we (currently) uninstall patches that exist on another track and are working when switching to a new track.

#

I'm not sure I understand what I'm seeing.

#

So a patch is currently only on one track at a time.

#

Looks like in the latest relase the patch is on beta

#

Sounds like there are two issues? readCurrentPatch() returning null (regardless of track)

#

and not uninstalling a patch when "switching" tracks?

#

Currently the track only applies to the check if I recall correctly, it's not recorded in the status file I don't think.

#

e.g. one is not "setting" a track for the app (other than during preview which is just changing the default track to use during requests), rather one is making a request for the latest patch on that track and installing it if available.

#

Happy to discuss other ways the track system could work 🙂

#

But readCurrentPatch() returning null when a patch is already installed sounds wrong.

pliant dust
#

Hi Eric,

Thanks for the clarification.

Regarding point 1, I agree it appears to be a bug. I checked my previous releases that had patches, and they are behaving as expected. I am open to further discussion to help narrow this down.

Regarding point 2, here is my understanding of the current behaviour:

  1. A patch request for a track only identifies which patches are available to be downloaded and installed.
  2. A patch is only discarded on the client side (app) if it is specifically marked as "rolled back."

Based on this, I would like to know if there is a way to uninstall a patch from another track when no patch is available on the stable track.

Here's a code snippet I'm using to check for updates:

    if (await _shorebird.checkForUpdate(track: _currentTrack) == UpdateStatus.outdated) {
        await _shorebird.update(track: _currentTrack);
        final nextPatch = await _shorebird.readNextPatch();
        _nextPatchNumber = nextPatch?.number;
      }
viscid island
#

I think the idea of "make this local install reflect the latest on this track" is a valid one.

#

@pliant dust in these times where readCurrentPatch was returning null, did the patch stay installed? Or was it about to un-install/rollback on next boot?

#

i'm trying to understand if this was a persistent state, e.g. "everything is working fine, patch 1 is install and booting, repeatedly, it just reports null when I ask readCurentPatch"

#

Or if it's "readCurrentPatch was null while it was booted from patch 1, but when I rebooted it rebooted from the base image"

#

or something else.

pliant dust
#

When I switched to beta track, the patch was downloaded and inflated successfully. On next restart, I confirmed that the changes I made reflected correctly, but the readCurrentPatch was still returning null. Hence, this caused the confusion initially. But on double checking, I confirmed that the changes in patch are reflecting. So I can say that the patch installed correctly.

viscid island
#

Is this just a "normal" Flutter app, or is this a hybrid/add2app setup where you're invoking FlutterEngine or FlutterEngineGroup explicitly?

pliant dust
#

Normal Flutter app. No add to app or hybrid.

viscid island
#

And were there any rollbacks involved here when this happened?

pliant dust
pliant dust
viscid island
#

Do you have any logs from this case?

pliant dust
#

These are a few more detailed ones, based on what functions are called in my codebase.

#

PS: these might not be that helpful.

viscid island
#

Those look like no patch is installed.

#

I think for now i'm going to assume readCurrentPatch being null was a fluke.

#

If you have any logs from a launch with readCurrentPatch == null, were you also believe a patch is installed, I'd love to see them

#

But otherwise I think the main takeaway is the feature request to be able to uninstall a patch or otherwise make the current installed state look like the latest of a given track.

pliant dust
#

Allow me sometime, I'll share new logs with you.

pliant dust
#

Please check these logs. These are logs for the entire flow:

Installing the release -> Switching to Beta -> Restarting the app

I have added, these separators in the logs for better understanding.


==========================AFTER RESTART=========================


==============================AFTER SWITCHING TO BETA TRACK=====
#

In these logs after the restart section, where ever you see NEEEEE LOGS:: shorebirdProperties - patchNumber: null, this is the case where the patch is installed, but the readCurrentPatchis returning null.

viscid island
#

I found the bug, thank you very much for the report

#

3.38.4 and before won't have the bug.