-
Notifications
You must be signed in to change notification settings - Fork 845
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
PM-14379: Stop storing 'null' in as the word separator #4219
Conversation
@@ -462,7 +462,7 @@ class GeneratorViewModel @Inject constructor( | |||
val newOptions = options.copy( | |||
type = PasscodeGenerationOptions.PasscodeType.PASSPHRASE, | |||
numWords = passphrase.numWords, | |||
wordSeparator = passphrase.wordSeparator.toString(), | |||
wordSeparator = passphrase.wordSeparator?.toString().orEmpty(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the ?
, we would stor the full word null
as the separator
@@ -351,7 +351,7 @@ class GeneratorViewModel @Inject constructor( | |||
GeneratorState.MainType.Passphrase( | |||
numWords = max(options.numWords, minNumWords), | |||
minNumWords = minNumWords, | |||
wordSeparator = options.wordSeparator.toCharArray().first(), | |||
wordSeparator = options.wordSeparator.toCharArray().firstOrNull(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the string can now be blank, we use null in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dseverns-livefront |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4219 +/- ##
==========================================
- Coverage 89.05% 89.05% -0.01%
==========================================
Files 445 445
Lines 38653 38653
Branches 5402 5403 +1
==========================================
- Hits 34422 34421 -1
Misses 2357 2357
- Partials 1874 1875 +1 ☔ View full report in Codecov by Sentry. |
🎟️ Tracking
PM-14379
📔 Objective
This PR fixes a bug where we were storing the word
null
as the word separator which caused the value to default to the first char,n
.⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmedissue and could potentially benefit from discussion
:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes