-
Notifications
You must be signed in to change notification settings - Fork 3
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
Minimal Hyperion Version #480
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
==========================================
- Coverage 54.18% 53.71% -0.47%
==========================================
Files 169 169
Lines 3739 3764 +25
==========================================
- Hits 2026 2022 -4
- Misses 1713 1742 +29 ☔ View full report in Codecov by Sentry. |
To explain that in a nutshell: it's the Titan counterpart of Hyperion config's On start (with the |
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 is an interesting and mandatory work.
Nice one for a first !!
I am considering another option, which is to make a provider storing the host, and the repository listening to this value when making repositoryProviders.
It will not require the GlobalData class and support dependency injection, which sounds better to me.
I will be glad to discuss this with you both !
32b1743
to
124af93
Compare
lib/tools/functions.dart
Outdated
var host = dotenv.env["${getAppFlavor().toUpperCase()}_HOST"]; | ||
|
||
if (host == null || host == "") { | ||
throw StateError("Could not find host corresponding to flavor"); | ||
} | ||
|
||
// Get backend version | ||
final response = await http.get(Uri.parse("$host/information")); |
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 may be mistaking, but I am under the impression we also make this request to check minimal_titan_version
. Could we combine the two verifications to only make one request?
lib/tools/functions.dart
Outdated
toDecode = utf8.decode(response.body.runes.toList()); | ||
var decoded = jsonDecode(toDecode); | ||
final version = decoded.version; | ||
final minimalHyperionVersion = "4.0.0"; |
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.
Could we move this constant in a more convenient place? Maybe the pubspec if possible.
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 was in a hurry when writing this, I made by analogy with Hyperion which has the version in a config.py
.
In this analogy, I don't really see a more relevant file than this one to write.
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 is indeed in config.py
which is the only hard-coded configuration file of Hyperion. For Titan the version and build number are already in the pubspec
There are 3 cases to consider (and test, assuming the flavor is
(that is, I tested the 3 cases and Titan is not stuck only in the 1st case so far) |
Note Update: now I can confirm it works in all cases. IMO there remain 3 things to consider:
|
Host was already static, thus we don't need to declare a global variable or a provider.
f0ac1a5
to
9d8e9f7
Compare
String getTitanHost() { | ||
var host = dotenv.env["${getAppFlavor().toUpperCase()}_HOST"]; | ||
Future<String> getTitanHost() async { | ||
const String minimalHyperionVersion = "4.0.0"; |
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.
Move this declaration in pubspec.yaml as it is the file where all versions are declared
These changes introduce a minimal Hyperion version to ensure Titan can work properly.
When a new Titan version with a new Hyperion including breaking changes (e.g. login system) is introduced, there will be a downtime because the stores take a few hours to review the version.
Thus, the new version is submitted to the store, this version will work because it will fall back to the alpha version.
No downtime anymore for introducing breaking changes.