Skip to content

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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

TheAabedKhan
Copy link
Member

Screenshots
pre-release

Copy link
Contributor

@kitadai31 kitadai31 left a 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.

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(),
Copy link
Contributor

@kitadai31 kitadai31 Apr 20, 2025

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?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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;
Copy link
Contributor

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)

Copy link
Member

@oSumAtrIX oSumAtrIX left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add feature/setting to pick pre-release patches instead
3 participants