shorebird icon indicating copy to clipboard operation
shorebird copied to clipboard

fix: preview not separating track caches correctly?

Open baptistemchl opened this issue 5 months ago • 8 comments

App ID: 714364b3-2ca2-4c54-b067-38f7d9a10a3b

Description

When i try to make a preview of a patch wich is on beta or staging i'm facing an issue. If i preview on stable everything is ok. BUT, i try a preview with staging or beta track, THEN, i try to preview on stable i have the same issue.

Steps To Reproduce

Flutter version of the app : 3.29.3 On W11 try to patch a release on track beta or staging

Expected Behavior

PS C:\Users\Baptiste\StudioProjects\untitled> shorebird preview --track beta --verbose
[HTTP] GET https://api.shorebird.dev/api/v1/apps/714364b3-2ca2-4c54-b067-38f7d9a10a3b/releases
[HTTP] GET https://api.shorebird.dev/api/v1/apps/714364b3-2ca2-4c54-b067-38f7d9a10a3b/releases?sideloadable=true
✓ Fetching releases (0.4s)                                                                                                                                                                                                
✓ Fetching releases (0.4s)                                                                                                                                                                                                
Which release would you like to preview?
❯ ◉  1.0.6+6
  ◯  1.0.5+5
  ◯  1.0.4+3
  ◯  1.0.3+3
  ◯  1.0.1+2
Which release would you like to preview? 1.0.6+6
[HTTP] GET https://api.shorebird.dev/api/v1/apps/714364b3-2ca2-4c54-b067-38f7d9a10a3b/releases/291524/artifacts?arch=aab&platform=android
✓ Fetching aab artifact (0.3s)                                                                                                                                                                                            
✓ Using beta track (0.5s)                                                                                                                                                                                                 
No checksum provided for patch.exe, skipping file corruption validation
No checksum provided for aot-tools.dill, skipping file corruption validation
[Process.runSync] C:\Users\Baptiste\.shorebird\bin\cache\flutter\3f14ca5f3bc037b703825519126bbe64aaee1827\bin\flutter.bat config --list --verbose
Exited with code 0

stdout:
[   +3 ms] Could not interpret results of "git describe": 3.32.8-0.0.pre.16
[  +46 ms] All Settings:
             enable-web: (Not set)
             enable-linux-desktop: (Not set)
             enable-macos-desktop: (Not set)
             enable-windows-desktop: (Not set)
             enable-android: (Not set)
             enable-ios: (Not set)
             enable-fuchsia: (Not set)
             enable-custom-devices: (Not set)
             cli-animations: (Not set)
             enable-native-assets: (Not set)
             enable-swift-package-manager: (Not set)
             explicit-package-dependencies: (Not set)
             jdk-dir: C:\Program Files\Java\jdk-17

[   +5 ms] "flutter config" took 31ms.
[        ] Running 1 shutdown hook
[        ] Shutdown hooks complete
[        ] exiting with code 0

[Process.runSync] C:\Users\Baptiste\.shorebird\bin\cache\flutter\3f14ca5f3bc037b703825519126bbe64aaee1827\bin\flutter.bat config --list --verbose
Exited with code 0

stdout:
[   +3 ms] Could not interpret results of "git describe": 3.32.8-0.0.pre.16
[  +66 ms] All Settings:
             enable-web: (Not set)
             enable-linux-desktop: (Not set)
             enable-macos-desktop: (Not set)
             enable-windows-desktop: (Not set)
             enable-android: (Not set)
             enable-ios: (Not set)
             enable-fuchsia: (Not set)
             enable-custom-devices: (Not set)
             cli-animations: (Not set)
             enable-native-assets: (Not set)
             enable-swift-package-manager: (Not set)
             explicit-package-dependencies: (Not set)
             jdk-dir: C:\Program Files\Java\jdk-17

[   +5 ms] "flutter config" took 31ms.
[        ] Running 1 shutdown hook
[        ] Shutdown hooks complete
[        ] exiting with code 0

[Process.runSync] C:\Users\Baptiste\.shorebird\bin\cache\flutter\3f14ca5f3bc037b703825519126bbe64aaee1827\bin\flutter.bat config --list --verbose
Exited with code 0

stdout:
[   +3 ms] Could not interpret results of "git describe": 3.32.8-0.0.pre.16
[  +48 ms] All Settings:
             enable-web: (Not set)
             enable-linux-desktop: (Not set)
             enable-macos-desktop: (Not set)
             enable-windows-desktop: (Not set)
             enable-android: (Not set)
             enable-ios: (Not set)
             enable-fuchsia: (Not set)
             enable-custom-devices: (Not set)
             cli-animations: (Not set)
             enable-native-assets: (Not set)
             enable-swift-package-manager: (Not set)
             explicit-package-dependencies: (Not set)
             jdk-dir: C:\Program Files\Java\jdk-17

[   +5 ms] "flutter config" took 32ms.
[        ] Running 1 shutdown hook
[        ] Shutdown hooks complete
[        ] exiting with code 0

[Process.run] "C:\Program Files\Java\jdk-17\bin\java.exe" -jar C:\Users\Baptiste\.shorebird\bin\cache\artifacts\bundletool\bundletool.jar dump manifest --bundle=C:\Users\Baptiste\.shorebird\bin\cache\previews\714364b3-2ca2-4c54-b067-38f7d9a10a3b\android_1.0.6+6_1221148.aab --xpath /manifest/@package
⠴ Extracting metadata... (3.1s)Exited with code 1                                                                                                                                                                         

stderr:
[BT:1.18.1] Error: File 'base/manifest/AndroidManifest.xml' not found.
com.android.tools.build.bundletool.model.exceptions.InvalidBundleException: File 'base/manifest/AndroidManifest.xml' not found.
        at com.android.tools.build.bundletool.model.exceptions.UserExceptionBuilder.build(UserExceptionBuilder.java:58)
        at com.android.tools.build.bundletool.commands.DumpManagerUtils.extractAndParse(DumpManagerUtils.java:195)
        at com.android.tools.build.bundletool.commands.DumpManagerUtils.extractAndParseFromAppBundle(DumpManagerUtils.java:160)
        at com.android.tools.build.bundletool.commands.DumpManager.printManifest(DumpManager.java:58)
        at com.android.tools.build.bundletool.commands.DumpCommand.execute(DumpCommand.java:153)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:130)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:56)

✗ Exception: Failed to extract package name from app bundle: [BT:1.18.1] Error: File 'base/manifest/AndroidManifest.xml' not found.
com.android.tools.build.bundletool.model.exceptions.InvalidBundleException: File 'base/manifest/AndroidManifest.xml' not found.
        at com.android.tools.build.bundletool.model.exceptions.UserExceptionBuilder.build(UserExceptionBuilder.java:58)
        at com.android.tools.build.bundletool.commands.DumpManagerUtils.extractAndParse(DumpManagerUtils.java:195)
        at com.android.tools.build.bundletool.commands.DumpManagerUtils.extractAndParseFromAppBundle(DumpManagerUtils.java:160)
        at com.android.tools.build.bundletool.commands.DumpManager.printManifest(DumpManager.java:58)
        at com.android.tools.build.bundletool.commands.DumpCommand.execute(DumpCommand.java:153)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:130)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:56)
 (3.2s)                                                                                                                                                                                                                   
[Process.run] git symbolic-ref HEAD (in C:\Users\Baptiste\.shorebird\bin\cache)
Exited with code 0

stdout:
refs/heads/stable

[Process.run] git rev-parse --verify HEAD (in C:\Users\Baptiste\.shorebird\bin\cache)
Exited with code 0

stdout:
417e36902157b84aff148e347da6241f5177648c

[Process.run] git remote prune origin (in C:\Users\Baptiste\.shorebird\bin\cache)
Exited with code 0
[Process.run] git fetch --tags (in C:\Users\Baptiste\.shorebird\bin\cache)
Exited with code 0
[Process.run] git rev-parse --verify @{upstream} (in C:\Users\Baptiste\.shorebird\bin\cache)
Exited with code 0

stdout:
417e36902157b84aff148e347da6241f5177648c`


baptistemchl avatar Jul 23 '25 13:07 baptistemchl

We might not be isolating our caches based on track?

eseidel avatar Jul 29 '25 17:07 eseidel

What do you mean ? Did i do something wrong ?

baptistemchl avatar Jul 29 '25 18:07 baptistemchl

No, I don't think you did anything wrong.

eseidel avatar Jul 29 '25 20:07 eseidel

Same issue here, is there any other way we can test the patch before making it live? @eseidel

RemonYounan avatar Aug 06 '25 14:08 RemonYounan

Mostly we should just fix shorebird preview. But you can always control the tracks manually with https://pub.dev/packages/shorebird_code_push, but you shouldn't have to here. shorebird preview --track beta should "just work".

eseidel avatar Aug 06 '25 18:08 eseidel

Ok, I tried with dev flavor with the normal stable track and tested the patch well. So this is a temporary workaround for now @baptistemchl

RemonYounan avatar Aug 07 '25 09:08 RemonYounan

@eseidel Any news on it ?

baptistemchl avatar Oct 10 '25 13:10 baptistemchl

No news. Still sounds like a caching error related to shorebird preview from the original report.

eseidel avatar Oct 10 '25 17:10 eseidel