-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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-12049] Remove usage of ActiveUserState from folder service #11880
Conversation
…tate Added extra test cases for encrypted folder and decrypted folders Updated derived state to use decrypt with key
This comment has been minimized.
This comment has been minimized.
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #11880 +/- ##
==========================================
- Coverage 33.73% 33.73% -0.01%
==========================================
Files 2918 2918
Lines 90929 91001 +72
Branches 17185 17201 +16
==========================================
+ Hits 30679 30696 +17
- Misses 57857 57905 +48
- Partials 2393 2400 +7 ☔ View full report in Codecov by Sentry. |
return []; | ||
} | ||
|
||
const decryptFolderPromises = folders.map((f) => f.decryptWithKey(userKey, encryptService)); |
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.
ℹ️ @bitwarden/team-platform-dev changed folder decryption to use decryptWithKey
instead of the decrypt
method.
|
||
folders$(userId$: Observable<UserId>): Observable<Folder[]> { | ||
return userId$.pipe( | ||
takeWhile((userId) => userId != null), |
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.
ℹ️ takeWhile
operator to stop folder state observations when userId becomes invalid (during logout)
this.folderViews$ = this.decryptedFoldersState.state$; | ||
folderViews$(userId$: Observable<UserId>): Observable<FolderView[]> { | ||
return userId$.pipe( | ||
takeWhile((userId) => userId != null), |
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.
ℹ️ takeWhile
operator to stop folder state observations when userId becomes invalid (during logout)
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.
Nice work on this so far!
I mostly just left a couple thoughts/comments on my concern with mixing Observable<UserId>
and UserId
arguments to the FolderService
. They're not hard change requests, but I think it something we should consider / discuss further.
Also, I do think we'll need to introduce the same UserId
requirement to the FolderApiService
to ensure we are always using the same userId throughout a submission.
.../tools/export/vault-export/vault-export-core/src/services/individual-vault-export.service.ts
Outdated
Show resolved
Hide resolved
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.
Looks good! But we do need to make Justin's suggested change.
e69e997
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-12049
📔 Objective
ActiveUserState
is being deprecated. Remove usage fromfolderService
and require userId to be passed.📸 Screenshots
⏰ 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 confirmed issue 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