Skip to content
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

Hide rooms we don't have the key for in recents list #1902

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Nov 16, 2023

This is an annoyingly large change duplicating a lot of the key management stuff into regular non-hooks functions since we can't call a hook in a loop. Feels like there should be a less terrible way of doing this.

@dbkr dbkr added the T-Defect Something isn't working: bugs, crashes, hangs, vulnerabilities, or other reported problems label Nov 16, 2023
@dbkr dbkr requested a review from a team as a code owner November 16, 2023 16:40
Comment on lines 48 to 50
// We set the Item by only using data from the url. This way we
// make sure, we always have matching pairs in the LocalStorage,
// as they occur in the call links.
Copy link
Member

Choose a reason for hiding this comment

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

I must admit that this comment is confusing to read - it implies that there's some data we could use that we avoid using here? But what is that data?

@@ -74,12 +83,14 @@ export const useRoomSharedKey = (roomId: string): string | undefined => {

export const useIsRoomE2EE = (roomId: string): boolean | null => {
Copy link
Member

Choose a reason for hiding this comment

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

Seeing | null on this return type makes me wonder what we were ever returning null for, and why we aren't doing that now

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like we used to return null if we couldn't find the room: https://github.com/vector-im/element-call/blame/535712d108a3257501457ae24f497dc7d52ed671/src/e2ee/sharedKeyManagement.ts#L76 - unsure why that changed though.

@codecov-commenter
Copy link

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (56c4ad0) 30.14% compared to head (b0dac56) 24.68%.
Report is 33 commits behind head on livekit.

Files Patch % Lines
src/e2ee/sharedKeyManagement.ts 20.00% 11 Missing and 1 partial ⚠️
src/matrix-utils.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           livekit    #1902      +/-   ##
===========================================
- Coverage    30.14%   24.68%   -5.47%     
===========================================
  Files           47       48       +1     
  Lines         1874     2382     +508     
  Branches       327      437     +110     
===========================================
+ Hits           565      588      +23     
- Misses        1264     1743     +479     
- Partials        45       51       +6     
Flag Coverage Δ
unittests 24.68% <18.75%> (-5.47%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbkr dbkr merged commit 95a44f5 into livekit Nov 21, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs, vulnerabilities, or other reported problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants