Repository navigation
fix: dedupe comparator, cross-ecosystem isolation, and URLEncoder API level - #25
Merged
Merged
Conversation
… URLEncoder API level - DeviceDao.DEVICE_ROW_COMPARATOR: invert boolean criteria to match natural max ordering, correctly preferring real serials over manual entries, mapped HDMI over unmapped, online over offline, and zero failures over failing devices. - Deduplication grouping: namespace grouping key by device type and include port for manual devices in both DeviceDao and DeviceCanonical, preventing cross-ecosystem device erasure when devices share an IP. - RokuEcpClient: use URLEncoder.encode(str, "UTF-8") instead of Charset overload (API 33+) to prevent NoSuchMethodError on Android 8-12 (minSdk 26) and resolve NewApi lint error. - HaloDpad: replace deprecated RingAction.values() with RingAction.entries. - gradlew: set executable permission bit in git (100755). - DeviceCanonicalTest: add tests for cross-type preservation on same IP and comparator preference.
…ial rekeying - Reorder DEVICE_ROW_COMPARATOR and DEVICE_COMPARATOR to prioritize liveness, health, and recency over hdmiPortMapping, preventing stale offline endpoints from winning on DHCP IP shifts. - Guard deletePairingCredential and migratePairingCredential in rekeyDeviceIdentity to only execute when staleDeviceId != merged.id. - Add regression tests covering same-type different-port preservation and liveness precedence over HDMI configuration.
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.
Summary of Changes
URLEncoder API Level Compatibility Fix (
RokuEcpClient.kt)URLEncoder.encode(char.toString(), Charsets.UTF_8)withURLEncoder.encode(char.toString(), "UTF-8").URLEncoder.encode(String, Charset)requires Android API 33+. On Android 8.0–12L (minSdk = 26), typing special characters in the TV keyboard caused runtimeNoSuchMethodErrorcrashes.NewApilint error on./gradlew :app:lintDebug.Deduplication Comparator Realignment (
DeviceDao.kt)DEVICE_ROW_COMPARATORso thatmaxWithOrNullcorrectly prefers:!it.uniqueId.startsWith("manual:"))it.hdmiPortMapping != null)it.isOnline)it.consecutiveFailures == 0)it.lastSeenMillis)DEVICE_COMPARATORinDeviceCanonical.kt.Cross-Ecosystem Deduplication Grouping (
DeviceDao.kt&DeviceCanonical.kt)typeand included endpoint port for manual devices ("${device.type}:${endpoint}").DeviceCanonicalTest.ktverifying cross-type retention and comparator precedence.Enum Modernization (
HaloDpad.kt)RingAction.values()toRingAction.entries.Toolchain Permissions (
gradlew)gradlewwith executable file mode100755.Verification
./gradlew :app:assembleDebug :app:testDebugUnitTest --rerun-tasks-> PASS (95/95 unit tests)./gradlew :app:lintDebug-> PASS (0 errors)