keepassxc icon indicating copy to clipboard operation
keepassxc copied to clipboard

Browser Integration code cleanup

Open varjolintu opened this issue 2 years ago • 1 comments

Cleanups the browser integration code to use structs whenever necessary. Decreases the amount of function parameters and adds some frequently used functions to the structs itself.

Testing strategy

Manually.

Type of change

  • ✅ Refactor (significant modification to existing code)

varjolintu avatar Sep 21 '22 07:09 varjolintu

Codecov Report

Base: 64.57% // Head: 64.69% // Increases project coverage by +0.12% :tada:

Coverage data is based on head (301390a) compared to base (3243243). Patch coverage: 7.96% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8489      +/-   ##
===========================================
+ Coverage    64.57%   64.69%   +0.12%     
===========================================
  Files          342      342              
  Lines        44372    44308      -64     
===========================================
+ Hits         28650    28663      +13     
+ Misses       15722    15645      -77     
Impacted Files Coverage Δ
src/browser/BrowserAction.h 25.00% <0.00%> (-75.00%) :arrow_down:
src/browser/BrowserMessageBuilder.h 100.00% <ø> (ø)
src/browser/BrowserService.cpp 28.97% <0.00%> (+0.07%) :arrow_up:
src/browser/BrowserService.h 100.00% <ø> (ø)
src/browser/BrowserAction.cpp 11.14% <5.67%> (+1.94%) :arrow_up:
src/browser/BrowserMessageBuilder.cpp 63.92% <50.00%> (+7.35%) :arrow_up:
src/core/Entry.cpp 82.52% <0.00%> (-0.20%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Oct 03 '22 06:10 codecov-commenter

Changes done that revert the asynchronous stuff.

varjolintu avatar Nov 01 '22 17:11 varjolintu

Maybe this could be merged after 2.7.5? I have already another PR coming that uses this branch as a base, fixing a few annoying bugs with the Access Confirm Dialog.

varjolintu avatar Nov 05 '22 15:11 varjolintu

This'll stay in develop not the 2.7.x line

droidmonkey avatar Nov 05 '22 22:11 droidmonkey

Man that looks great now!

droidmonkey avatar Feb 03 '23 10:02 droidmonkey

I could add a couple tests for the message creation, just in case.

varjolintu avatar Feb 03 '23 12:02 varjolintu

Yah that's a good idea, really to test expected parameters and the nonce matches would be fine.

droidmonkey avatar Feb 03 '23 13:02 droidmonkey

Yeah. It's actually quite easy to make a const QJsonObject just by mistake and add parameters there, which are not there at runtime. And the compiler doesn't complain about such errors.

EDIT: Made sure that I'm not doing those kind of errors..

varjolintu avatar Feb 03 '23 13:02 varjolintu