You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue:
When using AAPS for over 30 days, even after updating to the latest version on either master or dev branch (the issue has been reproduced on 3.3.0-dev-b as well as the latest master branch version), closed loop will be disabled and IOB will be limited to 0.0. When checking the logs one log reports "Version Checker: old version".
The cause:
On dev branch, VersionCheckerUtilsImpl.kt this function is deifned:
private fun checkVersion() =
if (isConnected()) {
Thread {
try {
val definition: String = URL("https://raw.githubusercontent.com/nightscout/AndroidAPS/versions/definition.json").readText()
val version: String? = AllowedVersions().findByApi(definition, Build.VERSION.SDK_INT)?.optString("supported")
compareWithCurrentVersion(version, config.get().VERSION_NAME)
// App expiration
var endDate = sp.getLong(rh.gs(app.aaps.core.utils.R.string.key_app_expiration) + "_" + config.get().VERSION_NAME, 0)
AllowedVersions().findByVersion(definition, config.get().VERSION_NAME)?.let { expirationJson ->
AllowedVersions().endDateToMilliseconds(expirationJson.getString("endDate"))?.let { ed ->
endDate = ed + T.days(1).msecs()
sp.putLong(rh.gs(app.aaps.core.utils.R.string.key_app_expiration) + "_" + config.get().VERSION_NAME, endDate)
}
}
if (endDate != 0L) onExpireDateDetected(config.get().VERSION_NAME, dateUtil.dateString(endDate))
} catch (e: IOException) {
aapsLogger.error(LTag.CORE, "Github master version check error: $e")
}
}.start()
} else
aapsLogger.debug(LTag.CORE, "Github master version not checked. No connectivity")
The function isConnected() is defined as such:
private fun isConnected(): Boolean = receiverStatusStore.isConnected
Where the implementation of ReceiverStatusStore (ReceiverStatusStoreImpl.kt) defines isConnected as such:
However, when this function is called on app launch, there is no network event yet, so this getter returns false.
Potential solution
I solved the issue manually by triggering checkVersion() later, i.e. after 1.5 seconds, and it solved the problem, however a more permanent solution could be triggering checkVersion() whenever there is a network change or at least the first time the network changes to "connected" during the app's lifecycle.
Other details
Recreated on version 3.3.0-dev-b as well as the latest master branch version
My device is Galaxy S23 Ultra
The text was updated successfully, but these errors were encountered:
The issue:
When using AAPS for over 30 days, even after updating to the latest version on either master or dev branch (the issue has been reproduced on 3.3.0-dev-b as well as the latest master branch version), closed loop will be disabled and IOB will be limited to 0.0. When checking the logs one log reports "Version Checker: old version".
The cause:
On dev branch, VersionCheckerUtilsImpl.kt this function is deifned:
The function isConnected() is defined as such:
Where the implementation of ReceiverStatusStore (ReceiverStatusStoreImpl.kt) defines isConnected as such:
However, when this function is called on app launch, there is no network event yet, so this getter returns false.
Potential solution
I solved the issue manually by triggering checkVersion() later, i.e. after 1.5 seconds, and it solved the problem, however a more permanent solution could be triggering checkVersion() whenever there is a network change or at least the first time the network changes to "connected" during the app's lifecycle.
Other details
Recreated on version 3.3.0-dev-b as well as the latest master branch version
My device is Galaxy S23 Ultra
The text was updated successfully, but these errors were encountered: