Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Fix crash on fishjam when updateMetadata is sent before renegotiation ends. #21

Closed
wants to merge 14 commits into from

Conversation

karkakol
Copy link
Member

@karkakol karkakol commented Jun 5, 2024

No description provided.

@@ -220,6 +223,7 @@ internal class InternalMembraneRTC(
trackId: String,
trackMetadata: Metadata
) {
if (!canUpdateMetadata)return
Copy link
Collaborator

Choose a reason for hiding this comment

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

formatting is broken

Copy link
Member Author

Choose a reason for hiding this comment

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

ktlint does not complain

@@ -347,6 +351,7 @@ internal class InternalMembraneRTC(
}
}
}
canUpdateMetadata = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we should use a mutex / coroutineScope instead (or other such mechanism)?
user can also do other things other than updating metadata so I'd prefer something that blocks other things completely

Copy link
Member Author

Choose a reason for hiding this comment

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

i will check on it

@@ -210,6 +212,7 @@ internal class InternalMembraneRTC(
}

fun updateEndpointMetadata(endpointMetadata: Metadata) {
if (!canUpdateMetadata)return
Copy link
Collaborator

Choose a reason for hiding this comment

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

also when we cannot update metadata we just fail silently?

@karkakol karkakol requested a review from graszka22 June 12, 2024 21:04
package org.membraneframework.rtc.error

enum class MembraneError(val message: String) {
TRACK_NOT_READY("Track was not confirmed by backed. Try again later")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd change this message to something like "Track updated while being negotiated in peer connection. Wait for the track to be negotiated.". "Track was not confirmed by the backend" and "Try again later" is too vague imo.
Now that I think about it, how user should wait for the negotiation?

@@ -219,11 +230,14 @@ internal class InternalMembraneRTC(
fun updateTrackMetadata(
trackId: String,
trackMetadata: Metadata
) {
): Result<Unit> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be easier to just throw exception?

@karkakol karkakol closed this Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants