Repository navigation
DEV-1124: honour the hardware in ShimmerVerObject.compareVersions - #314
Merged
Merged
Conversation
The static compareVersions(svo, hardwareVersion, fwId, ...) and the instance compareVersions(hardwareVersion, fwId, ...) that delegates to it never passed the hardware on, so a gate written as "Shimmer3 LogAndStream >= x" also matched a Shimmer3R. The two platforms' LogAndStream versions overlap, which is exactly where the hardware check matters. It now calls the hardware-aware UtilShimmer.compareVersions, where ANY_VERSION still matches every hardware. No existing caller changes result: each already checks isShimmerGen3() or isShimmerGen3R() alongside, or uses firmware that exists on only one hardware. API_00023 covers both overloads, ANY_VERSION, and the one gate that reached it with a hardware it relied on being ignored (isSupportedDerivedSensors). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes DEV-1124.
Defect
ShimmerVerObject.compareVersions(svo, hardwareVersion, fwId, …)never passed the hardware on, and neither did the instancecompareVersions(hardwareVersion, fwId, …), which delegates to it. Both called the hardware-agnosticUtilShimmer.compareVersions, so a gate written as "Shimmer3 LogAndStream ≥ x" also matched a Shimmer3R. The two platforms' LogAndStream versions overlap (both FW_ID 3), which is exactly where the hardware check matters.Fix
UtilShimmer.compareVersions, whereANY_VERSIONstill matches every hardware.ShimmerDevice.isThisVerCompatibleWith(hw, …)andShimmerBluetooth.isThisVerCompatibleWith(hw, …)already behaved.Impact: latent, no current caller changes result
Every caller was audited in Shimmer-Java-Android-API, Shimmer-Advance-API and ConsensysApps:
ShimmerDevice.isHWAndFWSupportedBtBleControl/isHWAndFWSupportedUsbControl/isSupportedRn4678ErrorDetectionisShimmerGen3()/isShimmerGen3R()alongside the callShimmerDevice.isSupportedSrProgViaDockisShimmerGen3R()ShimmerDevice.isSupportedDerivedSensors(viaisVerCompatibleWith(svo, hw, …))isShimmerGen3R()/isShimmerGenGq()/isShimmerGen4(); testedLiteProtocol.writeLEDCommandBOILER_PLATEfirmware exists only on Shimmer2RThis removes a trap for the next gate. DEV-1123's new gate (#313) had to bypass this method because of it.
Testing
API_00023_ShimmerVerObjectHardwareGateTest(5 tests):ANY_VERSIONmatches both;isSupportedDerivedSensorsstays true for Shimmer3 ≥ 0.3.17 and for Shimmer3R.cd ShimmerDriver && ./gradlew test: 124 tests, 0 failures.Siblings (CLAUDE.md §4)
compareVersionshas no hardware-taking overload; its callers check the hardware explicitly.atLeastplus explicit hardware checks.None of them has this defect.
🤖 Generated with Claude Code