Status-react: Message from A is shown to B in the beginning of 1-1 chat if chat was deleted by A and started again

Created on 10 May 2017  路  10Comments  路  Source: status-im/status-react

Description

Type: Bug

Summary: A has 1-1 chat with B. A deletes chat with B. A starts new chat with B by opening B from Contacts and sending new message "New after delete". For B new message is shown in the beginning of 1-1 chat instead of being shown at the end.
Issue demonstrates itself in the same way as in #1051 and #1015

chat with misplaced message after chat delete

Expected behavior

New message is shown at the end of conversation in 1-1 chat

Actual behavior

New message is shown as a second message in the beginning of 1-1 chat

Reproduction

  • As Alice:

    • Open Status and login

    • Add Bob to your contacts by scanning QR code

    • Write to Bob "Hi Bob"

  • As Bob:

    • Open Status and login

    • Open Chats

    • Tap on new chat with unknown contact (Alice)

    • Reply to Allice "Hi alice [add time]"

  • As Alice

    • Wait for message from Bob

    • Write to Bob "will delete this chat [add time]"

    • Go back to Chats screen (tap on <)

    • In Chats screen tap "..." in top right corner

    • In menu select Edit chats

    • Next to the chat with Bob tap on "..."

    • Tap on Delete chat

    • Open Contacts

    • Tap on Bob

    • In chat write to Bob new message "NEW after delete on [add time]

  • As Bob

    • check where is the message from Alice "New after delete" placed

Additional Information

  • Status version: 0.9.6-66
  • Operating System: Android and iOS
Tested - OK bug medium-priority

All 10 comments

I can reproduce it as described in case we have syncing very slow, so the very first message from A to B is "pending" and appears in the end of the chat later

https://app.testfairy.com/projects/4803622-status/builds/6285165/sessions/8/?accessToken=KCfHyfM5ggARF/JqlxuvPex6H5k

@asemiankevich At what time in that video does this happen?

@oskarth I 've seen it today less then hour ago on 0.9.8-114-g243cb7de+ branch, right after this syncing became slow again.

@asemiankevich I mean the linked video is almost 40 minutes long, at what timestamp does the problem occur?

@oskarth gosh))) sorry for that) it is the first 5 minutes)

@asemiankevich thanks, will have a look

@asemiankevich The sequence of events in the video in first 3 minutes isn't clear to me, it seems like it is all happening on a different phone not recorded? Could you write down what action what account is taking in what order? Thanks

@oskarth yeah sure

Reproduction

As Alice:

  • Open Status and login
  • Add Bob to your contacts by scanning QR code
  • Write to Bob "First message" (notice the message status is stuck on "sending")

As Bob:

  • Open Status and login
  • Open Chats
  • Notice that no new chat is created because message is stuck on Sending

As Alice:

  • Get back to Alice and delete chat with Bob
  • Send new message "Second message" to Bob

As Bob:

  • Tap on new chat with unknown contact (Alice)
  • Reply to Allice "Hi alice [add time]"

As Alice

  • Wait for message from Bob
  • Write to Bob "will delete this chat [add time]"
  • Go back to Chats screen (tap on <)
  • In Chats screen tap "..." in top right corner
  • In menu select Edit chats
  • Next to the chat with Bob tap on "..."
  • Tap on Delete chat
  • Open Contacts
  • Tap on Bob
  • In chat write to Bob new message "NEW after delete on [add time]

As Bob

  • check where is the message from Alice "New after delete" placed
  • Pay attention that the very first message "First message" is now at the end of the chat

@asemiankevich Unable to reproduce the original issue on this branch. I suspect this has something to do with: (notice the message status is stuck on "sending" As far as I can tell from the issue description this is a separate issue.

Would you mind trying to reproduce again when there are no weird pending message issues? The related PR should be merged into develop soon, which might introduce related fixes that makes the pending message / syncing more stable.

If you are unable to reproduce the original issue I think we should open a new issue, since, if I understand it correctly, the problem might not have anything to do with "deleting" messages but just a pending message being resent after another message? It'd be great to get a minimal case on that one, since I suspect it has something to do with the order we retry sending messages. I don't know how to simulate the bad pending message, though.

If you are able to reproduce the original issue again without the pending message thing, we'll have to debug further to see what is different in our setups.

@oskarth yeah, I will open separate issue for this Pending messages. Need to test and dig more into it as I can't reproduce it now. The original PR can be merged as planned

Was this page helpful?
0 / 5 - 0 ratings