threema-ch / threema-web

The Threema Web application.
GNU Affero General Public License v3.0
993 stars 106 forks source link

Recieving a message while typing in the same chat #717

Closed RogoTe closed 5 years ago

RogoTe commented 5 years ago

Expected Behavior

When beeing in a chat and typing and recieving a new message while typing on my side in this chat I want to continue typing my message continuously.

Current Behavior

While typing a message and recieving a message in the same chat a) side reloads and some of my key presses get lost and b) coursor is placed at the beginning of the message field so my key presses after the loss of case a) are placed at the beginning of the message.

Possible Solution

Sorry, I am not into web applications, maybe isolate the type message field into a separate iframe?

Your Environment

joelfischerr commented 5 years ago

This is also happening in Electron/Chromium and Safari 12.0.2. Sending a message and then starting to type the next one also triggers this bug.

It is possible to switch back to an earlier version of Threema Web by using it from https://web.threema.ch/archive/2.1.3/. As there were no security issues in the last version it should be fine.

RogoTe commented 5 years ago

@joelfischerr Thanks, good tip.

dbrgn commented 5 years ago

I cannot currently reproduce this.

Does the problem occur every time, or only from time to time?

joelfischerr commented 5 years ago

I could have sworn it happened every time on my desktop yesterday. But I can't reproduce it consistently on my laptop now.

Steps to reproduce it eventually (around every 10 messages sent):

  1. Send message to ECHOECHO
  2. Start typing the next message immediately
  3. Repeat

I have attached the last lines of the console log after the bug occured. The relevant line might be

ARIA: Attribute " aria-label ", required for accessibility, is missing on node:

dbrgn commented 5 years ago

Hm, I sent probably about 50 messages to ECHOECHO and could still not reproduce the issue. But I'm using Android, maybe the problem only occurs with iOS. Could be related to reconnecting behavior, which is much more common with iOS than with Android.

@joelfischerr since you mentioned the archive, does the problem not occur on 2.1.3?

joelfischerr commented 5 years ago

I can't recall ever having seen this behavior in earlier versions.

Is there a way to force a reconnect?

On 21 Jan 2019, at 12:43, Danilo Bargen notifications@github.com wrote:

Hm, I sent probably about 50 messages to ECHOECHO and could still not reproduce the issue. But I'm using Android, maybe the problem only occurs with iOS. Could be related to reconnecting behavior, which is much more common with iOS than with Android.

@joelfischerr since you mentioned the archive, does the problem not occur on 2.1.3?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

joelfischerr commented 5 years ago

This might be a more reliable way to reproduce the bug:

  1. Send a long message (one that will be split into multiple parts) to ECHOECHO
  2. Start typing
  3. Force quit the app on the iPhone before the last message comes back from ECHOECHO
  4. The next incoming message shows up at the same time as the bug occurs.

It seems to occur on every reconnect if I'm typing when the reconnect is happening.

On 21 Jan 2019, at 12:43, Danilo Bargen notifications@github.com wrote:

Hm, I sent probably about 50 messages to ECHOECHO and could still not reproduce the issue. But I'm using Android, maybe the problem only occurs with iOS. Could be related to reconnecting behavior, which is much more common with iOS than with Android.

@joelfischerr since you mentioned the archive, does the problem not occur on 2.1.3?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

dbrgn commented 5 years ago

You can see the connection status from the color of the dot in the "ThreemaWeb." logo. Green means "actively connected" while orange means that the iOS app process was stopped. Orange means that a reconnect will happen as soon as some activity happens on the app or Threema Web side.

RogoTe commented 5 years ago

Hi, I did the same test @joelfischerr suggested and found, that the problem only occurs when Threema app on iOS is not in forground. When Threema is in backround or phone is in standby initial stated problem happens.

This is what I got in console:

Console Log ``` Sending update/typing message angular.js:15536:16 [WebClientService] Currently not connected, queueing chunk angular.js:15536:16 Sending create/textMessage message angular.js:15536:16 [WebClientService] Currently not connected, queueing chunk angular.js:15536:16 Sending update/typing message angular.js:15536:16 [WebClientService] Currently not connected, queueing chunk angular.js:15536:16 [PushService] Sent push angular.js:15536:16 [WebClientService] Requested app wakeup via apns push angular.js:15536:16 [WebClientService] Called requestRead on a message without id angular.js:15536:16 Sending update/typing message angular.js:15536:16 [WebClientService] Currently not connected, queueing chunk angular.js:15536:16 [StateService] Connection buildup state: push => peer_handshake angular.js:15536:16 [StatusController] Connection buildup advanced: angular.js:15536:16 [WebClientService] Initializing NotificationService... angular.js:15536:16 [NotificationService] Notification API available: true angular.js:15536:16 [NotificationService] Initial notificationPermission true angular.js:15536:16 [NotificationService] Fetching settings... angular.js:15536:16 [SettingsService] Retrieving settings key: notifications angular.js:15536:16 [SettingsService] Retrieving settings key: notificationPreview angular.js:15536:16 [SettingsService] Retrieving settings key: notificationSound angular.js:15536:16 [NotificationService] Desktop notifications: true angular.js:15536:16 [NotificationService] Requesting notification permission... angular.js:15536:16 [NotificationService] Notification preview: true Using default value (true) angular.js:15536:16 [SettingsService] Storing settings key: notificationPreview angular.js:15536:16 [NotificationService] Notification sound: true angular.js:15536:16 [WebClientService] Sending connection info (resume=yes, sn-in=17) angular.js:15536:16 Sending update/connectionInfo message angular.js:15536:16 [StateService] Signaling connection state: peer-handshake => task angular.js:15536:16 [StateService] Task connection state: new => connected angular.js:15536:16 [StatusController] State change: warning -> ok angular.js:15536:16 [SettingsService] Storing settings key: notifications angular.js:15536:16 [NotificationService] Notification permission true angular.js:15536:16 New incoming message (108 bytes) angular.js:15536:16 Received update/connectionInfo message angular.js:15536:16 Received connectionInfo from device angular.js:15536:16 [WebClientService] Received connection info (resume=yes, sn-out=16) angular.js:15536:16 Pruning cache (local-sn=20, remote-sn=16) angular.js:15536:16 Chunk cache pruned, acknowledged: 16, left: 4, size: 1618 -> 129 angular.js:15536:16 Chunk cache transferred (1 chunks) angular.js:15536:16 [WebClientService] Sending cached chunks: 1 angular.js:15536:16 [WebClientService] Session resumed angular.js:15536:16 [StateService] Connection buildup state: peer_handshake => done angular.js:15536:16 [WebClientService] Reset initialization steps angular.js:15536:16 [StateService] Connection buildup state: done => loading angular.js:15536:16 Sending update/typing message angular.js:15536:16 [VersionService] Checking for version update... angular.js:15536:16 ARIA: Attribute " aria-label ", required for accessibility, is missing on node: angular.js:15536:16 [WebClientService] requestMessages angular.js:15536:16 [WebClientService] requestMessages: No more messages available angular.js:15536:16 New incoming message (68 bytes) angular.js:15536:16 Received update/batteryStatus message angular.js:15536:16 Received battery status angular.js:15536:16 [BatteryStatusService] 91%, discharging angular.js:15536:16 Sending update/typing message angular.js:15536:16 [WebClientService] Called requestRead on a message without id angular.js:15536:16 New incoming message (158 bytes) angular.js:15536:16 Received update/conversation message angular.js:15536:16 Received conversation update angular.js:15536:16 New incoming message (336 bytes) angular.js:15536:16 Received update/conversation message angular.js:15536:16 Received conversation update angular.js:15536:16 New incoming message (255 bytes) angular.js:15536:16 Received update/messages message angular.js:15536:16 Received messages update angular.js:15536:16 New incoming message (117 bytes) angular.js:15536:16 Received create/textMessage message angular.js:15536:16 Received create message response angular.js:15536:16 New incoming message (374 bytes) angular.js:15536:16 Received update/receiver message angular.js:15536:16 Received receiver update angular.js:15536:16 New incoming message (359 bytes) angular.js:15536:16 Received update/conversation message angular.js:15536:16 Received conversation update angular.js:15536:16 New incoming message (273 bytes) angular.js:15536:16 Received update/messages message angular.js:15536:16 Received messages update angular.js:15536:16 New incoming message (273 bytes) angular.js:15536:16 Received update/messages message angular.js:15536:16 Received messages update angular.js:15536:16 New incoming message (252 bytes) angular.js:15536:16 Received update/messages message angular.js:15536:16 Received messages update angular.js:15536:16 New incoming message (273 bytes) angular.js:15536:16 Received update/messages message angular.js:15536:16 Received messages update angular.js:15536:16 Sending read request for contact ECHOECHO (msg cpfmDl9LBDo=) angular.js:15536:16 Sending request/read message angular.js:15536:16 New incoming message (53 bytes) angular.js:15536:16 Received update/confirm message angular.js:15536:16 Received wire message acknowledgement angular.js:15536:16 Versuch, eine verbotene Kopfzeile zu verwenden, wurde abgelehnt: Connection 308263936-lcs_client_bin.js:134:386 [VersionService] Checking for version update... angular.js:15536:16 Sending update/connectionAck message angular.js:15536:16 Sending update/typing message angular.js:15536:16 [Exception... "Component returned failure code: 0x805e0006 [nsIChannel.asyncOpen2]" nsresult: "0x805e0006 ()" location: "JS frame :: resource:///modules/FaviconLoader.jsm :: load :: line 104" data: no] Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf https://avatars2.githubusercontent.com/favicon.ico blockiert ("default-src"). ```
dbrgn commented 5 years ago

I can confirm this behavior with an iOS device. This is most probably related to #728.

ovalseven8 commented 5 years ago

Is this fixed because #728 is alread closed?

dbrgn commented 5 years ago

Good catch, yep, this should be fixed.

(If not, feel free to leave a comment.)