Skip to content

Refactor how we deal with user permissions. #4235

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

Merged
merged 2 commits into from
Jun 20, 2025
Merged

Conversation

stefanceriu
Copy link
Member

This patch introduces a new RoomPowerLevelsProxy and its associated mock and adopts newer Rust APIs to make working with user power levels and permissions easier.

…ions.

This patch introduces a new RoomPowerLevelsProxy and its associated mock and adopts newer Rust APIs to make working with user power levels and permissions easier.
@stefanceriu stefanceriu requested a review from a team as a code owner June 20, 2025 11:21
@stefanceriu stefanceriu added the pr-misc for other changes label Jun 20, 2025
@stefanceriu stefanceriu requested review from Velin92 and removed request for a team June 20, 2025 11:21
Copy link

github-actions bot commented Jun 20, 2025

Warnings
⚠️ This pull request seems relatively large. Please consider splitting it into multiple smaller ones.
⚠️ You seem to have made changes to views. Please consider adding screenshots.

Generated by 🚫 Danger Swift against c053e93

Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 99.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.17%. Comparing base (6bf26ce) to head (c053e93).
Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...TimelineScreen/ThreadTimelineScreenViewModel.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4235   +/-   ##
========================================
  Coverage    79.17%   79.17%           
========================================
  Files          798      798           
  Lines        74915    74927   +12     
========================================
+ Hits         59311    59325   +14     
+ Misses       15604    15602    -2     
Flag Coverage Δ
unittests 71.26% <99.00%> (+0.04%) ⬆️

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.

Copy link
Member

@pixlwave pixlwave Jun 20, 2025

Choose a reason for hiding this comment

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

So silly question. Can we now include this powerLevels struct in Rust's roomInfo so that we don't even need to await a get on it?

Copy link
Member

Choose a reason for hiding this comment

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

That way we could just use the RoomInfoProxy from the publisher in all these screens like we do for everything else.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah, that's a really good idea. Let me see if I can push it through Rust side

Copy link
Member

@Velin92 Velin92 left a comment

Choose a reason for hiding this comment

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

the PR looks good from an implementation point of view, but the mocking part is a bit confusing, I think we should narrow permission mocking only to the RoomPowerLevelsProxyMock instrad of having this hybrid approach between the RoomProxy and the former.

Copy link
Member

@Velin92 Velin92 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@stefanceriu stefanceriu merged commit cbf405a into develop Jun 20, 2025
13 checks passed
@stefanceriu stefanceriu deleted the stefan/powerLevels branch June 20, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-misc for other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants