Initial content scanner integration#7139
Conversation
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
d227064 to
e96b0f2
Compare
ca86d89 to
1df9a59
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #7139 +/- ##
===========================================
+ Coverage 80.53% 80.57% +0.03%
===========================================
Files 2705 2710 +5
Lines 78030 78114 +84
Branches 10532 10544 +12
===========================================
+ Hits 62843 62938 +95
+ Misses 11128 11110 -18
- Partials 4059 4066 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| } else { | ||
| error("Either response or error must be provided") | ||
| } | ||
| } |
There was a problem hiding this comment.
We could use mockwebserver but it's also OK.
There was a problem hiding this comment.
I just tried using MockWebServer and while it works, it's also harder to set up and in some cases I end up having to use a mix of mocking (for spies) and the web server, so I'm not sure it's worth it. If @ganfra thinks we should change this too I can upload those changes.
ganfra
left a comment
There was a problem hiding this comment.
Thanks for the changes, LGTM now!
- Add `:features:contentscanner:api` module with the interface. - Implement the concrete component using the Rust SDK in `:libraries:matrix:impl`. This can be used to both set up the content scanner media fetching in the SDK Client and manually scanning media sources from the Android side
…api` module as a noop implementation Use it as a placeholder for the code to instantiate a `RustContentScanner` with the fetched URL and set it as part of the SDK client.
…be reused for the non-session bound retriever. Also add the new `content_scanner_url` field to it. This will be used by the enterprise code to fetch the actual content scanner url.
…rl provider implementation
This needed some tweaks to `RetrofitFactory`
Co-authored-by: Benoit Marty <benoitm@element.io>
Co-authored-by: Benoit Marty <benoitm@element.io>
… checking if we're running unit tests in `MediaSource.toRustMediaSource`
0271e0c to
2ada023
Compare
|



Content
Create the base APIs to be able to use an optional content scanner for the media in the app:
:features:contentscannermodules.ContentScannerwrapper for theRustContentScannerone.ContentScannerUrlProviderinterface and implement a noop version for the FOSS app so we don't instantiate a content scanner in that case.@SessionScope.Motivation and context
Closes #7122.
Tests
Check with FOSS that everything works as before.
With Pro, use the counterpart branch to check the element-well known file is fetched. Sadly, we have no example HS with this value, so the most you can probably do is using
Proxymanor some other MITM proxy to override the response for that endpoint and point to a content scanner instance you have running somewhere. Details on how to run a content scanner server are detailed in the parent story.Tested devices
Checklist