-
-
Notifications
You must be signed in to change notification settings - Fork 818
feat: Pre-release patches toggle #1785
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
Conversation
Why limit it to alternative sources? You can pass ?dev=true to achieve the same with the ReVanced API |
Are changelogs/updates considered as well? @Ushie I am not sure but are queries ignored by cache on CloudFlare? Because then, using the dev query has no effect. |
I already tried ?dev=true at ReVanced API, but it didn't effect. If the cache issue will be fixed, I think I should wait for it.
Yes. These lines change the data source of patches update dialog according to the settings. revanced-manager/lib/ui/views/home/home_viewmodel.dart Lines 482 to 490 in e88e997
|
One thing I noticed after building this branch (rebased) was that checking for |
Can you share the apk here please |
@nivranaitsirhc sure [redacted] |
# Conflicts: # lib/services/github_api.dart # lib/services/manager_api.dart # lib/ui/views/home/home_viewmodel.dart
If there are multiple dev releases on the same day, they will be sorted by alphabetically. Therefore, releases[0] is not guaranteed to be the latest. vX.X.X-dev.10 will be older than vX.X.X-dev.9 so we have to iterate several releases and find the latest
Waiting for the parameter issue in ReVanced API to be fixed I have some questions
|
If the stable version is newer than the most recent pre-release, then the stable version will be used, so make it clear.
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.
@oSumAtrIX Does v3 suffer from the same issues regarding the ?dev parameter, supporting the API is a prerequisite for this PR
Future<Map<String, dynamic>?> getLatestReleaseWithPreReleases( | ||
String repoName, | ||
) async { | ||
try { | ||
final response = await _dio.get('/repos/$repoName/releases?per_page=10'); | ||
final List<dynamic> releases = response.data; | ||
|
||
/* | ||
* Loop through all releases (including pre-releases) and return the latest | ||
*/ | ||
Map<String, dynamic>? latestRelease; | ||
DateTime latestReleaseDate = DateTime.fromMillisecondsSinceEpoch(0); | ||
for (final release in releases) { | ||
final DateTime releaseDate = DateTime.parse(release['published_at']); | ||
if (releaseDate.isAfter(latestReleaseDate)) { | ||
latestReleaseDate = releaseDate; | ||
latestRelease = release; | ||
} | ||
} | ||
return latestRelease; | ||
} on Exception catch (e) { | ||
if (kDebugMode) { | ||
print(e); | ||
} | ||
return null; | ||
} | ||
} | ||
|
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.
Maybe instead of making a new function, add a parameter to the existing one instead
A ?dev query parameter does intendedly not exist and is not planned to be added. The TLDR is that the dev branch is not a controlled release channel like a "beta" channel would be. If we were to want to add a beta channel, we would need do introduce significant changes as well as maintenance overhead as the beta channel would be a new production channel next to the main channel. |
The dev branch has nothing to do with this, the flag can be renamed to ?prereleases instead of ?dev because it simply enables returning prereleases |
The name does not change that pre releases are not a controlled production release channel. Any further discussion should happen in the API repo and not in this PR |
Yeah, I've heard that ReVanced API v2 was deprecated. So, I think it's enough to revert this PR to the beginning. (Pre-release requires alternative sources to be enabled, #1785 (comment)) |
7f6666c
to
820cd72
Compare
Add a toggle for pre-release patches to the alternative source settings.
Closes: #821
This PR also fixes an problem where pre-release Integrations are being used when using alternate sources.
At this time, Patches are referring
GitHubAPI#getLatestPatchesRelease()
that doesn't include pre-releases, but Integrations are referringGitHubAPI#getLatestRelease()
that includes pre-releases.This problem actually caused patched apps to crash recently in crimera/piko patches (an alternative source) when they released a pre-releases.
(Actually, this is the main motivation)
getLatestReleaseFile()
ingithub_api.dart
was removed because it's unused