-
Notifications
You must be signed in to change notification settings - Fork 815
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
[iOS] Integrate Jitsi SDK with Transcription support and JitsiSDK Update #23323
Conversation
1eaf065
to
64dd6a7
Compare
@@ -35,3 +35,13 @@ public func XCTAssertAsyncNoThrow<T>( | |||
XCTFail(message(), file: file, line: line) | |||
} | |||
} | |||
|
|||
// swift-format-ignore | |||
public func XCTunwrapAsync<T>( |
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.
minor nit: XCTUnwrapAsync
|
||
import Collections | ||
import Foundation | ||
@_spi(AppLaunch) import Shared |
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.
Don't need @_spi(AppLaunch)
since you're not updating the channel in this test
@MainActor | ||
func processTranscript(dictionary: [AnyHashable: Any]) async { |
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.
Why does simple JSON decoding have to be done on the main actor?
@@ -3693,3 +3694,13 @@ extension BrowserViewController { | |||
present(chatController, animated: true) | |||
} | |||
} | |||
|
|||
extension BraveTalkJitsiCoordinator: AIChatBraveTalkJavascript { | |||
@MainActor |
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.
main actor is not needed
import Foundation | ||
import os.log | ||
|
||
public class BraveTalkJitsiTranscriptProcessor { |
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.
Seems like you want an actor
here based on number of MainActor
additions
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.
It has been an actor but @Brandon-T reverted it to a class when integrating with Leo :P I think he ran into some issues
@@ -14,6 +14,7 @@ public class AIChatViewModel: NSObject, ObservableObject { | |||
private var api: AIChat! | |||
private weak var webView: WKWebView? | |||
private let script: any AIChatJavascript.Type | |||
private let braveTalkScript: AIChatBraveTalkJavascript? |
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.
(any AIChatBraveTalkJavascript)?
@@ -19,3 +19,8 @@ public protocol AIChatJavascript { | |||
@MainActor | |||
static func getPrintViewPDF(webView: WKWebView) async -> Data | |||
} | |||
|
|||
public protocol AIChatBraveTalkJavascript { | |||
@MainActor |
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.
why main actor isolated?
[puLL-Merge] - brave/brave-core@23323 DescriptionThis PR adds the ability to use Brave Talk transcripts as context for AI chat. It introduces a new The main motivation for this change seems to be enhancing the AI chat experience by leveraging the conversation context from Brave Talk calls. ChangesChanges
Security HotspotsThe main potential security concern I see is around handling the transcript data received from Jitsi. It's important to ensure this external data is properly validated and sanitized before using it in any way, to prevent issues like injection attacks or unintended data leakage. The current implementation does deserialize the received data, but it would be good to have an extra validation step. The tests added for |
Resolves brave/brave-browser#38368
Security ticket https://github.com/brave/reviews/issues/1613
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Few notes