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

Add TimelineProxy (update sdk to 0.0.7-november23) #2178

Merged
merged 26 commits into from
Nov 28, 2023

Conversation

alfogrillo
Copy link
Contributor

@alfogrillo alfogrillo commented Nov 28, 2023

This PR updates the matrix rust sdk to 0.0.7-november23.
The important change is the introduction of the new ffi type Timeline and our wrapper of it TimelineProxy

Copy link

github-actions bot commented Nov 28, 2023

Warnings
⚠️ This pull request seems relatively large. Please consider splitting it into multiple smaller ones.
⚠️ Please add a changelog.
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.

Generated by 🚫 Danger Swift against 8ab023f

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

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

Comparison is base (9a2c348) 71.43% compared to head (198bdc3) 71.50%.
Report is 1 commits behind head on develop.

❗ Current head 198bdc3 differs from pull request most recent head 8ab023f. Consider uploading reports for the commit 8ab023f to get more accurate results

Files Patch % Lines
...ne/TimelineController/RoomTimelineController.swift 0.00% 18 Missing ⚠️
...Sources/FlowCoordinators/RoomFlowCoordinator.swift 0.00% 13 Missing ⚠️
...Services/SecureBackup/SecureBackupController.swift 0.00% 7 Missing ⚠️
...rces/Services/Timeline/TimelineProxyProtocol.swift 0.00% 6 Missing ⚠️
...viewScreen/MediaUploadPreviewScreenViewModel.swift 0.00% 5 Missing ⚠️
ElementX/Sources/Application/AppCoordinator.swift 0.00% 3 Missing ⚠️
...eens/RoomScreen/RoomScreenInteractionHandler.swift 0.00% 3 Missing ⚠️
...s/Services/VoiceMessage/VoiceMessageRecorder.swift 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2178      +/-   ##
===========================================
+ Coverage    71.43%   71.50%   +0.06%     
===========================================
  Files          515      516       +1     
  Lines        35238    35234       -4     
  Branches     16951    16946       -5     
===========================================
+ Hits         25172    25193      +21     
+ Misses        9444     9417      -27     
- Partials       622      624       +2     
Flag Coverage Δ
unittests 57.45% <5.08%> (+0.18%) ⬆️

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.

@alfogrillo alfogrillo marked this pull request as ready for review November 28, 2023 11:28
@alfogrillo alfogrillo requested a review from a team as a code owner November 28, 2023 11:28
@alfogrillo alfogrillo requested review from pixlwave and stefanceriu and removed request for a team November 28, 2023 11:28
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

There's a ton of changes here but it all seems fine to me. Let's trust that our various tests will pick up eventual issues.

Very nicely done! 👏

Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

Yeah, looks like a decent change to me.

I wonder about the use of the timeline provider now. e.g. some places call timelineProvider.sendBlah() which forwards it to its timeline proxy, whereas other places call roomProxy.timeline.sendBlah() which feels a bit messy having both options. We should probably decide which makes more sense with this new object being a thing.

@alfogrillo
Copy link
Contributor Author

Yeah, looks like a decent change to me.

I wonder about the use of the timeline provider now. e.g. some places call timelineProvider.sendBlah() which forwards it to its timeline proxy, whereas other places call roomProxy.timeline.sendBlah() which feels a bit messy having both options. We should probably decide which makes more sense with this new object being a thing.

Maybe I didn't get it well.
Do you mean the forward between the RoomTimelineController and the TimelineProxy?

Unfortunately we can't inject just the TimelineProxy in the RoomTimelineController.
Some methods (eg. redact) are available at the RoomProxy level :/

@pixlwave
Copy link
Member

pixlwave commented Nov 28, 2023

Sorry yes, I meant the controller. I always get those 2 mixed up 🤦‍♂️

I was meaning from the outside, sometimes we call timelineController.sendMessage and othertimes we call e.g. roomProxy[.timeline].sendPollResponse. It would be nice to have consistency here and always use one or the other as a pattern.

@alfogrillo
Copy link
Contributor Author

Sorry yes, I meant the controller. I always get those 2 mixed up 🤦‍♂️

I was meaning from the outside, sometimes we call timelineController.sendMessage and othertimes we call e.g. roomProxy[.timeline].sendPollResponse. It would be nice to have consistency here and always use one or the other as a pattern.

Oh, I see what you mean.
I don't see much value on wrapping RoomProxy methods in the TimelineController unless it handles additional logics (one example is editMessage).
But we should think about this better, especially if the TimelineController becomes generic enough to be used also in other contexts (eg. in the poll history).

Copy link

sonarcloud bot commented Nov 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.3% 0.3% Duplication

@alfogrillo alfogrillo enabled auto-merge (squash) November 28, 2023 18:33
@alfogrillo alfogrillo merged commit e749416 into develop Nov 28, 2023
6 checks passed
@alfogrillo alfogrillo deleted the alfogrillo/update-rust-sdk branch November 28, 2023 19:01
@alfogrillo alfogrillo self-assigned this Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants