duckduckgo / iOS

DuckDuckGo iOS Application
https://itunes.apple.com/us/app/duckduckgo-privacy-browser/id663592361?mt=8
Apache License 2.0
1.79k stars 405 forks source link

[DuckPlayer] - 4. Remote Config #3018

Closed afterxleep closed 4 days ago

afterxleep commented 6 days ago

Task/Issue URL: https://app.asana.com/0/1204099484721401/1207593922684293/f

Description:

Steps to test this PR:

  1. Enable DP via loading this Privacy Config: https://www.jsonblob.com/api/1252645298605252608
  2. Smoke test DuckPlayer
  3. Change DuckPlayer to be in Always ask mode
  4. Open a Youtube video and confirm you see the overlay
  5. Without changing the URL, Disable DP by loading this Privacy Config: to https://jsonblob.com/api/1257316236932276224
  6. Right after you load it, the video will start playing.
  7. Close settings, and you'll not see the overlay anyumore
  8. Navigate to a duck:// URL, like: duck://player/9vhR1RnMbSA
  9. Confirm you're redirected to the Youtube video.
github-actions[bot] commented 6 days ago
Warnings
:warning: PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by :no_entry_sign: dangerJS against 3b44a93be3e67d45d6e4961cc630785d67c72825

Bunn commented 5 days ago

@afterxleep I'm getting a crash when tapping on "watch here" in the overlay

image
(lldb) bt
* thread #28, queue = 'com.apple.root.user-initiated-qos.cooperative', stop reason = Simultaneous accesses to 0x60000187a050, but modification requires exclusive access
    frame #0: 0x000000019326df68 libswiftCore.dylib`_swift_runtime_on_report
    frame #1: 0x000000019326e654 libswiftCore.dylib`swift::runtime::AccessSet::insert(swift::runtime::Access*, void*, void*, swift::ExclusivityFlags) + 516
    frame #2: 0x000000019326e6ac libswiftCore.dylib`swift_beginAccess + 72
    frame #3: 0x0000000102827dd0 DuckDuckGo`DuckPlayer.settings.getter at <compiler-generated>:0
    frame #4: 0x0000000102829094 DuckDuckGo`protocol witness for DuckPlayerProtocol.settings.getter in conformance DuckPlayer at <compiler-generated>:0
  * frame #5: 0x00000001029ed9b4 DuckDuckGo`YoutubeOverlayUserScript.handleSettingsChange(self=0x000060000265f1e0) at YoutubeOverlayUserScript.swift:134:60
    frame #6: 0x00000001029ed830 DuckDuckGo`closure #1 in YoutubeOverlayUserScript.subscribeToDuckPlayerMode(self=0x000060000265f1e0) at YoutubeOverlayUserScript.swift:45:23
    frame #7: 0x000000010253ae48 DuckDuckGo`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0
    frame #8: 0x00000001b7de3208 Combine`Combine.Subscribers.Sink.receive(τ_0_0) -> Combine.Subscribers.Demand + 84
    frame #9: 0x00000001b7de381c Combine`protocol witness for Combine.Subscriber.receive(τ_0_0.Input) -> Combine.Subscribers.Demand in conformance Combine.Subscribers.Sink<τ_0_0, τ_0_1> : Combine.Subscriber in Combine + 20
    frame #10: 0x00000001b7dee1d0 Combine`Combine.PassthroughSubject.Conduit.offer(τ_0_0) -> () + 396
    frame #11: 0x00000001b7def48c Combine`partial apply forwarder for closure #1 (Combine.ConduitBase<τ_0_0, τ_0_1>) -> () in Combine.PassthroughSubject.send(τ_0_0) -> () + 40
    frame #12: 0x00000001b7e23ba4 Combine`partial apply forwarder for reabstraction thunk helper <τ_0_0, τ_0_1 where τ_0_1: Swift.Error> from @callee_guaranteed (@guaranteed Combine.ConduitBase<τ_0_0, τ_0_1>) -> (@error @owned Swift.Error) to @escaping @callee_guaranteed (@in_guaranteed Combine.ConduitBase<τ_0_0, τ_0_1>) -> (@error @owned Swift.Error) + 24
    frame #13: 0x000000019304b148 libswiftCore.dylib`Swift.Sequence.forEach((τ_0_0.Element) throws -> ()) throws -> () + 440
    frame #14: 0x00000001b7e2361c Combine`Combine.ConduitList.forEach((Combine.ConduitBase<τ_0_0, τ_0_1>) throws -> ()) throws -> () + 184
    frame #15: 0x00000001b7dedc64 Combine`Combine.PassthroughSubject.send(τ_0_0) -> () + 168
    frame #16: 0x000000010289b654 DuckDuckGo`DuckPlayerSettings.triggerNotification(self=0x000060000267e3a0) at DuckPlayerSettings.swift:157:35
    frame #17: 0x000000010289b5ec DuckDuckGo`DuckPlayerSettings.updateSettings(notification=Foundation.Notification @ 0x000000016e3e1f30, self=0x000060000267e3a0) at DuckPlayerSettings.swift:153:8
    frame #18: 0x000000010289b6e4 DuckDuckGo`@objc DuckPlayerSettings.updateSettings(_:) at <compiler-generated>:0
    frame #19: 0x00000001803de7e8 CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 140
    frame #20: 0x00000001803de70c CoreFoundation`___CFXRegistrationPost_block_invoke + 84
    frame #21: 0x00000001803ddbfc CoreFoundation`_CFXRegistrationPost + 404
    frame #22: 0x00000001803dd5d8 CoreFoundation`_CFXNotificationPost + 688
    frame #23: 0x0000000180da1994 Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 88
    frame #24: 0x0000000102d7f61c DuckDuckGo`AppUserDefaults.duckPlayerMode.setter(newValue=alwaysAsk, self=0x0000000106409d10) at AppUserDefaults.swift:396:40
    frame #25: 0x0000000102d80d08 DuckDuckGo`protocol witness for AppSettings.duckPlayerMode.setter in conformance AppUserDefaults at <compiler-generated>:0
    frame #26: 0x000000010289ae74 DuckDuckGo`DuckPlayerSettings.mode.setter(newValue=alwaysAsk, self=0x000060000267e3a0) at DuckPlayerSettings.swift:127:40
    frame #27: 0x000000010289b85c DuckDuckGo`protocol witness for DuckPlayerSettingsProtocol.mode.setter in conformance DuckPlayerSettings at <compiler-generated>:0
    frame #28: 0x00000001028280e4 DuckDuckGo`DuckPlayer.setUserValues(params=2 key/value pairs, message=0x00006000011f7510, self=0x000060000187a040) at DuckPlayer.swift:89:23
    frame #29: 0x00000001028290dc DuckDuckGo`protocol witness for DuckPlayerProtocol.setUserValues(params:message:) in conformance DuckPlayer at <compiler-generated>:0
    frame #30: 0x00000001029efb20 DuckDuckGo`implicit closure #2 in implicit closure #1 in YoutubeOverlayUserScript.handler(params=2 key/value pairs, message=0x00006000011f7510, self=0x000060000187a040) at YoutubeOverlayUserScript.swift:97:31
    frame #31: 0x00000001028e15f0 DuckDuckGo`thunk for @escaping @callee_guaranteed (@in_guaranteed Any, @guaranteed WKScriptMessage) -> (@out Encodable?) at <compiler-generated>:0
    frame #32: 0x00000001029f14d4 DuckDuckGo`thunk for @escaping @callee_guaranteed (@in_guaranteed Any, @guaranteed WKScriptMessage) -> (@out Encodable?)partial apply at <compiler-generated>:0
    frame #33: 0x00000001068719bc UserScript`UserScriptMessageBroker.execute(action=respond, original=0x00006000011f7510, self=0x00006000026e00c0) at UserScriptMessaging.swift:231
    frame #34: 0x00000001082fbf3c BrowserServicesKit`ContentScopeUserScript.userContentController(userContentController=0x0000600003d2a490, message=0x00006000011f7510, self=0x00006000118a98c0) at ContentScopeUserScript.swift:195
    frame #35: 0x00000001082fc4a8 BrowserServicesKit`@objc closure #1 in ContentScopeUserScript.userContentController(_:didReceive:) at <compiler-generated>:0
    frame #36: 0x00000001082fea58 BrowserServicesKit`partial apply for @objc closure #1 in ContentScopeUserScript.userContentController(_:didReceive:) at <compiler-generated>:0
    frame #37: 0x00000001082feb44 BrowserServicesKit`thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #38: 0x00000001082fec98 BrowserServicesKit`partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () at <compiler-generated>:0
    frame #39: 0x00000001082fed8c BrowserServicesKit`specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out τ_0_0) at <compiler-generated>:0
    frame #40: 0x00000001082feee4 BrowserServicesKit`partial apply for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out τ_0_0) at <compiler-generated>:0