-
-
Notifications
You must be signed in to change notification settings - Fork 815
feat: Add toggle to use pre-releases #2485
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
base: dev
Are you sure you want to change the base?
Conversation
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.
This enables Manager pre-releases, but currently, Manager update check is disabled for dev versions.
revanced-manager/lib/ui/views/home/home_viewmodel.dart
Lines 137 to 140 in a8e192b
Future<bool> hasManagerUpdates() async { | |
if (!_managerAPI.releaseBuild) { | |
return false; | |
} |
(This _managerAPI.releaseBuild
variable will only be true if the app is release build and the version name doesn't contain -dev
.)
This needs to be addressed.
@@ -20,6 +21,7 @@ class SAdvancedSection extends StatelessWidget { | |||
title: t.settingsView.advancedSectionTitle, | |||
children: const <Widget>[ | |||
SAutoUpdatePatches(), | |||
SUsePrereleases(), |
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.
I think "Data sources" section is more suitable than "Advanced" section for this setting
because this setting exactly controls the data source
(However, this setting also controls updates to the Manager, so it might be questionable whether it belongs entirely to the data source?)
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.
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.
Data source is fine. Manager updates is also provided by a data source (API)
try { | ||
final response = await _dioGetSynchronously( | ||
'/repos/$repoName/releases/latest', | ||
'/repos/$repoName/releases$prerelease', | ||
); | ||
return response.data; |
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.
Alternative sources are not working.
The /releases/latest
endpoint returns a single release object, whereas the /releases
endpoint returns an array of releases.
(even if you specified ?per_page=1
)
So, this have to be return response.data[0];
for pre-releases.
E/flutter (22529): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'FutureOr<Map<String, dynamic>?>'
E/flutter (22529): #0 GithubAPI.getLatestRelease (package:revanced_manager/services/github_api.dart:43:23)
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.
In addition, the toggle should warn the user and suggest not to use dev releases via a dialog. On toggle, the user should be prompted to restart to consume the new data.
Screenshots
