Conversation
Some Delta Chat clients (Desktop, for example) do `leave_webxdc_realtime` regardless of whether we've ever joined a realtime channel in the first place. Such as when closing a WebXDC window. This might result in unexpected and suspicious firewall warnings. Related: - #6443. - deltachat/deltachat-desktop#3218.
src/peer_channels.rs
Outdated
| pub async fn leave_webxdc_realtime(ctx: &Context, msg_id: MsgId) -> Result<()> { | ||
| if !ctx.get_config_bool(Config::WebxdcRealtimeEnabled).await? { | ||
| let Some(iroh) = ctx.get_peer_channel().await else { | ||
| warn!( |
There was a problem hiding this comment.
There's no need in the warning as this is a normal case
There was a problem hiding this comment.
I think in a perfect world, DC clients shouldn't call this when they know that the channel has not been initialized. But also feel free to apply the suggestion.
There was a problem hiding this comment.
There's no API to know whether the peer channels are initialized. They just initialize lazily. Even if such an API appears, using it will cause race conditions as the peer channels may be initialized in parallel
There was a problem hiding this comment.
I'm not sure if I'm following. Take a look at our WebXDC preload in Desktop:
leave_webxdc_realtime is supposed to be called only if the app invoked joinRealtimeChannel, which invokes sendWebxdcRealtimeAdvertisement, which is supposed to initialize peer_channels in Core. So a DC client knows if an app uses realtime API.
There was a problem hiding this comment.
OK, feel free to ignore this. Not a big deal I guess.
There was a problem hiding this comment.
Ok, now i got it that a DC client knows that, but it looks simpler to allow calling leave_webxdc_realtime() unconditionally like it's done currently in DC Desktop
Some Delta Chat clients (Desktop, for example)
do
leave_webxdc_realtimeregardless of whether we've ever joined a realtime channel
in the first place. Such as when closing a WebXDC window.
This might result in unexpected and suspicious firewall warnings.
Related:
TODO:
negative side effects, e.g. that we actually don't need
to initialize Iroh on
leave_webxdc_realtimeand, say, delete the topic from the database.