fix: inconsistent error messages when credentials fail to save#2737
fix: inconsistent error messages when credentials fail to save#2737Maanvi212006 wants to merge 4 commits into
Conversation
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2737 +/- ##
==========================================
- Coverage 91.92% 91.79% -0.13%
==========================================
Files 650 650
Lines 19893 19898 +5
Branches 4351 4474 +123
==========================================
- Hits 18286 18266 -20
- Misses 1605 1630 +25
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
zFernand0
left a comment
There was a problem hiding this comment.
zFernand0
left a comment
There was a problem hiding this comment.
Forgot to request changes 🙏
@zFernand0 Thanks for the review! |
t1m0thyj
left a comment
There was a problem hiding this comment.
Thanks for your work on this @Maanvi212006! Please resolve failing unit tests:
Errors thrown in packages/imperative/src/config/__tests__/ConfigAutoStore.unit.test.ts
● Test suite failed to run
packages/imperative/src/config/__tests__/ConfigAutoStore.unit.test.ts:577:53 - error TS2304: Cannot find name 'handlerParams'.
577 await ConfigAutoStore.storeSessCfgProps(handlerParams as any, {
~~~~~~~~~~~~~
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>


fixes #1907
What It Does
config.save()was called without using thesecureSaveErrorhelperConfigAutoStore.tsandConvertV1Profiles.tsUsers were seeing the raw unhelpful messageFailed to load Keytar moduleinstead of the consistent, user-friendlyUnable to securely save credentials message` with possible solutionsconfig.save()calls in try/catch blocks that throwConfigUtils.secureSaveError()on failureHow to Test
Before fix: error message shows Failed to load Keytar module: ...
After fix: error message shows Unable to securely save credentials. Possible Solutions: ...
Review Checklist
I certify that I have:
Additional Comments
ConfigUtilsimport was also added toConvertV1Profiles.tsas it was not previously imported there.