Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions bootstrap/helpers/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,9 @@ function get_route_parameters(): array
function get_latest_sentinel_version(): string
{
try {
$response = Http::get(config('constants.coolify.versions_url'));
$versions = $response->json();
$versions = get_versions_data();

return data_get($versions, 'coolify.sentinel.version');
return data_get($versions, 'coolify.sentinel.version', '0.0.0');
Copy link
Member

Choose a reason for hiding this comment

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

Sentinel doesn't depend on a specific Coolify version. This way, people would never be able to receive the latest version until they update Coolify. I think it would be better if we keep the network request, and only read the local version if that request fails as the "new fallback".

Copy link
Author

Choose a reason for hiding this comment

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

@Cinzya in the new commit,
0.0.0 is just a final safety fallback:
The value 0.0.0 is only used if both the network fetch and the local file fail (which is extremely unlikely).

} catch (\Throwable) {
return '0.0.0';
}
Expand Down