Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Add key backup tests #3071

Merged
merged 5 commits into from
Apr 28, 2023
Merged

Add key backup tests #3071

merged 5 commits into from
Apr 28, 2023

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented Apr 28, 2023

Also slightly refactors the functions and methods to rely less on the req/res pattern we had for polylith.

Returns M_WRONG_ROOM_KEYS_VERSION for some endpoints as per the spec

@S7evinK S7evinK added spec-compliance Fix something that doesn't comply with the specs T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. labels Apr 28, 2023
@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Patch coverage: 73.40% and project coverage change: +0.18 🎉

Comparison is base (d23d036) 66.57% compared to head (9117c95) 66.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3071      +/-   ##
==========================================
+ Coverage   66.57%   66.75%   +0.18%     
==========================================
  Files         496      496              
  Lines       53525    53491      -34     
==========================================
+ Hits        35634    35710      +76     
+ Misses      14275    14181      -94     
+ Partials     3616     3600      -16     
Flag Coverage Δ
unittests 49.83% <73.40%> (+0.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
userapi/api/api.go 70.90% <ø> (ø)
userapi/internal/user_api.go 65.13% <70.00%> (+2.00%) ⬆️
clientapi/routing/key_backup.go 78.01% <71.42%> (+23.12%) ⬆️
clientapi/jsonerror/jsonerror.go 82.75% <100.00%> (+1.74%) ⬆️

... and 21 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@S7evinK S7evinK marked this pull request as ready for review April 28, 2023 13:35
@S7evinK S7evinK requested a review from a team as a code owner April 28, 2023 13:35
return nil
}
func (a *UserInternalAPI) DeleteKeyBackup(ctx context.Context, userID, version string) (bool, error) {
return a.DB.DeleteKeyBackup(ctx, userID, version)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've lost validation here. Previous code checked version was not empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already handled at the router level, with a missing {version} variable the functions isn't called. Added a test anyway.

@S7evinK S7evinK merged commit 9e9617f into main Apr 28, 2023
@S7evinK S7evinK deleted the s7evink/cskeybackup branch April 28, 2023 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
spec-compliance Fix something that doesn't comply with the specs T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants