Skip to content

Conversation

Nonary
Copy link

@Nonary Nonary commented Mar 25, 2023

Description

This pull request fixes a bug in the code that prevents the version update from working properly for nightly builds. The changes made in this pull request ensure that the expected behavior is met, which is to suggest a new nightly release when available, and only suggest a stable release if it has a higher version number than the nightly release.

Changes Made:

Updated the hasNewStable method to check nightly builds by comparing the latest nightly version tag with the stable version, and only returning true if the latest stable version is higher than their current nightly version. If the user does not have a nightly version of Sunshine, the existing functionality of the method remains the same.

Fixed a bug in the hasNewNightly method by using pop() instead of indexing by -1. JavaScript does not use negative indexes, so that would have returned back undefined instead of their original intended design decision, which was to retrieve the last index of the version split.

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

…ve indexes

I guess this was someone who was used to too much Python :)

Also added an additional check to remove stable releases that aren't a new version
Copy link
Member

@ReenigneArcher ReenigneArcher left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! A few changes requested. Once the requested changes are made, I'll get this merged right away.

Chase Payne added 3 commits March 25, 2023 14:30
This commit refactors the stableBuildAvailable() and nightlyBuildAvailable() computed properties to improve code clarity. The buildVersionIsStable() method has been renamed to isStableBuild() for better naming consistency, and the nightlyBuildAvailable() computed property has been renamed to isNightlyBuildAvailable() to more clearly indicate its purpose.
Previously, the version check was incorrectly splitting the version number string by "-g" instead of ".", resulting in an error that prevented the check from properly detecting the version.

This commit fixes the bug by updating the version check to split the version number string by ".", which is the correct delimiter for version numbers
I changed the style of this boolean check to be more consistent with the other booleans
I've also changed the order of the boolean checks in the method so it doesn't short circuit and exit out early, it will check for version first.
@ReenigneArcher ReenigneArcher merged commit 9b0e056 into LizardByte:nightly Mar 26, 2023
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.

3 participants