-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(shorebird_code_push): add download update functionality #37
Conversation
# Conflicts: # shorebird_code_push/lib/src/shorebird_code_push.dart # shorebird_code_push/lib/src/updater.dart # shorebird_code_push/test/src/shorebird_code_push_test.dart # shorebird_code_push/test/src/updater_test.dart
await _shorebirdCodePush.downloadUpdate(); | ||
_nextPatchVersion = await _shorebirdCodePush.nextPatchNumber(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these ever throw? Should they be wrapped in a try/catch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these ever throw?
Not as it stands. If the underlying ffi code throws, we catch those errors and log them.
} | ||
|
||
/// Downloads the latest patch, if available. | ||
Future<void> downloadUpdate() async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to return a Stream of progress updates eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#38 :)
@@ -2,48 +2,101 @@ import 'dart:isolate'; | |||
|
|||
import 'package:shorebird_code_push/src/updater.dart'; | |||
|
|||
/// A function that constructs an [Updater] instance. Used for testing. | |||
typedef UpdaterBuilder = Updater Function(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use @VisibleForTesting if you like, although that would add a package:meta dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already had the meta dependency, so I did that and also made a forTest
constructor so UpdaterBuilder isn't part of the public API.
Description
Adds support for triggering patch download from a Flutter app.
Also adds logging for ffi errors to help point users in the correct direction when things aren't working as expected.
Type of Change