Commit Graph

122 Commits

Author SHA1 Message Date
Eric Seidel 1eb9340ad6 Separate patch download/install
This separates patch download from install, which makes it possible for us to later asynchronously download patches into the downloads spot and then install them on completion.

This also makes marking patches good/bad actually do something and tests that it does something.

We're still quite aways away from actually validating patches and having good/bad be meaningful (for example good/bad are never called by the engine code yet) but this is a step in that direction.

activate_latest_bootable_patch is also only used the "set bad" codepath, and isn't even used when installing patches (those still manually set the current slot).

This also makes it so the slot index is now optional, which makes slightly more sense?  And would be needed in the case where you have a single bad patch installed in slot 1, with slot 0 empty/invalid and you resolve to a "None" selected.

Lots more to do here, but this is a start.
2023-03-17 13:53:04 -07:00
Felix Angelov f5103bc1e8 refactor(updater): conform to new backend interfaces (#90) 2023-03-17 13:00:35 -05:00
Felix Angelov d0eaf8d330 chore(updater): dart format (#85) 2023-03-17 10:08:34 -05:00
Eric Seidel 1f8842e5b5 feat: Add two more rust tests (#82) 2023-03-16 11:18:30 -07:00
Eric Seidel e188d61085 feat: Start adding rust tests. (#81) 2023-03-16 12:01:44 -05:00
Felix Angelov ab8ef34ca0 refactor(updater): remove client_id (#78) 2023-03-15 14:18:29 -05:00
Felix Angelov d4c84ea9cf chore: rename product_id to app_id (#77) 2023-03-15 14:11:13 -05:00
Eric Seidel dfcc356e27 Remove duplicate imports 2023-03-15 09:49:07 -07:00
Eric Seidel e9e1b8a0f4 refactor: Use methods instead of free functions with UpdateState (#74) 2023-03-15 09:45:18 -07:00
Eric Seidel d6bb3b9f12 chore: fix TODO about libapp.txt (#73) 2023-03-15 11:29:24 -05:00
Eric Seidel a50c1d3126 docs: Add ability to mark patches good/bad (not used yet) (#70) 2023-03-14 14:41:28 -07:00
Eric Seidel df1bf4a50d docs: Document intended updater arch (#63) 2023-03-14 12:43:38 -07:00
Eric Seidel f9e8ad5099 Move current_platform and current_arch to config.rs 2023-03-13 09:50:53 -07:00
Eric Seidel 98bcdd96bc Log the outbound json 2023-03-13 09:38:31 -07:00
Eric Seidel 53d092c20d Log network responses in rust 2023-03-13 09:24:04 -07:00
Eric Seidel b18ac7b947 feature: Teach the rust updater library about shorebird.yaml (#54) 2023-03-10 23:49:19 -06:00
Felix Angelov da702e4ce9 chore: resolve analysis warnings (#53) 2023-03-09 15:51:27 -08:00
Felix Angelov edc020611a feat: upgrade shorebird tools to new API (#52) 2023-03-09 17:38:01 -06:00
Eric Seidel eacc7e8b87 Make updater library thread safe
This was needed so that it could be called from Dart as well as flutter_main/C++.

It turns out flutter_main does not run on the "ui thread", so when Dart was calling
into the updater it would panic due to thinking the updater (which was using a thread local) was not yet initialized.

Also added the log-panics crate on Android so that panics appear in adb logcat.
2023-03-08 13:03:13 -08:00
Eric Seidel 52ec7f3c4e refactor: split updater library into layers (#47) 2023-03-08 11:11:10 -06:00
Eric Seidel 6199b33b24 chore: Fix .gitignores (#28) 2023-03-07 02:21:28 +00:00
Eric Seidel f757251162 chore: Fix the rust build (#27) 2023-03-06 15:06:31 -08:00