Closed Bug 1193665 Opened 6 years ago Closed 6 years ago

Entering a conversation multiple times from link-clicker UI causes duplicated received text messages

Categories

(Hello (Loop) :: Client, defect, P2)

defect
Points:
2

Tracking

(firefox43 verified)

VERIFIED FIXED
mozilla43
Iteration:
43.1 - Aug 24
Tracking Status
firefox43 --- verified

People

(Reporter: standard8, Assigned: standard8)

Details

(Whiteboard: [text chat bug][standalone])

Attachments

(1 file)

STR:

1) Join a conversation from both the link clicker + desktop
2) Send messages between the two, verify that any particular message is received only once.
3) On the link clicker, leave the conversation
4) Re-join the conversation on the link clicker
5) Send messages between the two

Actual Results

=> Messages received by the link clicker are duplicated (ones to the desktop side are not)

Expected Results

=> No duplication
Whiteboard: [text chat] → [text chat][standalone]
Rank: 25
Flags: qe-verify+
Priority: P1 → P2
Whiteboard: [text chat][standalone] → [text chat bug][standalone]
I believe the sdk re-uses subscribers & publishers (or at least some aspects of them), as a result, what is happening is the bit that handles "readyForDataChannel" is being called twice, and ends up listening twice for the messages from the data channel.

Looks like when I implemented this code, I forgot to add the new event to the off in the disconnect session.

I've now also written a couple of tests to ensure that things that are listened to in on the publisher/subscriber are always turned off when we disconnect from the session - hence, we'll fail tests if anyone else forgets to update both sections.
Attachment #8651795 - Flags: review?(mdeboer)
Points: --- → 2
Comment on attachment 8651795 [details] [diff] [review]
Entering a conversation multiple times from link-clicker UI causes duplicated received text messages.

Review of attachment 8651795 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM. Thanks!

::: browser/components/loop/content/shared/js/otSdkDriver.js
@@ +272,5 @@
>        }));
>  
>        if (this.session) {
> +        this.session.off("sessionDisconnected streamCreated streamDestroyed connectionCreated connectionDestroyed " +
> +                         "streamPropertyChanged signal:readyForDataChannel");

According to splinter, you're already splitting the string too late :P
Attachment #8651795 - Flags: review?(mdeboer) → review+
https://hg.mozilla.org/mozilla-central/rev/eefc618fb592
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
I was not able to reproduce the initial issue since it was something changed in Standalone and using an old version of Nightly will have the latest changes in Standalone. 
Though I can confirm that this is not reproducible using latest Firefox Developer Edition 43.0a2 across platforms (Windows 7 64-bit, Mac OS X 10.11 and Ubuntu 14.04 32-bit).
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.