Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getSignalsMatching when passed V1 as version + minor refactor #86

Merged
merged 1 commit into from
May 16, 2023

Conversation

Sergey-Makarov
Copy link
Contributor

Problem:
getSignalsMatching(V1, Stable/Optimal) returned a wrong list of signals, because this method did not take into account that when using V1 version, some signals should be treated as Stable even if their stability level is Optimal/Unique.

What is affected
The problem did not affect our backward compatibility with older fingerprints, because the method Fingerprinter.getFingerprint(..) internally did not use getSignalsMatching for versions representing legacy fingerprint scheme (v1..v4) and already respected the rule described above.

Therefore, the only way to experience the problem was to use getSignalsMatching(V1, Stable/Optimal) directly, and I
highly doubt that someone uses V1 for this purpose nowadays :) However, one could observe this bug when trying our demo app if the following steps were made:

  1. Change fingerprint version to V1
  2. Switch between optimal and unique stability levels

One could see that the fingerprint remains the same, even though the list of signals actually does change. After the fix, during the same steps the list of signals will remain the same as it should.

): T? {
return if (
signalFingerprintingInfo.stabilityLevel.atLeastAsStableAs(requiredStabilityLevel)
&& requiredVersion.inRange(signalFingerprintingInfo.addedInVersion, signalFingerprintingInfo.removedInVersion)

Check warning

Code scanning / detekt

Line detected that is longer than the defined maximum line length in the code style. Warning

Line detected that is longer than the defined maximum line length in the code style.
@Sergey-Makarov Sergey-Makarov changed the base branch from main to release/2.0.1 May 16, 2023 15:02
@Sergey-Makarov Sergey-Makarov merged commit 64d96c4 into release/2.0.1 May 16, 2023
3 checks passed
@Sergey-Makarov Sergey-Makarov deleted the fix_get_signals_matching_v1 branch April 23, 2024 16:16
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.

None yet

2 participants