Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat: Messages are not being grouped by received date #8962

Closed
glitchminer opened this issue Jan 4, 2023 · 5 comments · Fixed by #9146
Closed

Chat: Messages are not being grouped by received date #8962

glitchminer opened this issue Jan 4, 2023 · 5 comments · Fixed by #9146
Assignees
Labels
bug Something isn't working
Milestone

Comments

@glitchminer
Copy link
Contributor

Bug Report

Description

In chat history, messages from the same day are split up and divided by messages from other days. Noted after upgrading to 0.9rc1 but may have been occurring previously.

For example,

  • December 23
    • message 1
  • December 26
    • message 3
  • December 23
    • message 2
  • December 26
    • message 4
  • December 27
    • message 6
  • December 26
    • message 5

Steps to reproduce

Unknown, does not appear on all chats. Upgraded to 0.9, scrolled up in group chat to view message history.

Expected behavior

Messages are grouped by day

Actual behavior

Messages are not grouped by day

Additional Information

  • Status desktop version: 0.9
  • Operating System: Mac
@glitchminer glitchminer added bug Something isn't working Chat labels Jan 4, 2023
@glitchminer glitchminer changed the title Chat: Days are not in order Chat: Messages are not being grouped by received date Jan 4, 2023
@iurimatias iurimatias added this to the 0.9.0 RC milestone Jan 5, 2023
@osmaczko
Copy link
Contributor

Can't reproduce anymore. Most likely fixed by: #9001

@osmaczko
Copy link
Contributor

I can reproduce it on 0.9.0 RC2.

The root cause behind this is: diverged whisper_timestamp values.

clock_value whisper_timestamp timestamp text c_t username chat_id response_to
1673514570146 1673514573000 1673514570146 A 1 Curvy... 06b9cf6b...  
1673516761013 1673516763000 1673516761013 B 1 Delicious... 06b9cf6b... 0x524c...
1673517063622 1673599961000 1673517063622 C 1 Sardonic... 06b9cf6b... 0x524c...
1673517347444 1673600248000 1673517347444 D 1 Sardonic... 06b9cf6b... 0x2a4e...
1673521819673 1673521821000 1673521819673 E 7 Curvy... 06b9cf6b...  
1673521820173 1673521827000 1673521820173 F 1 Curvy... 06b9cf6b...  

Converted to datetime:

clock_value whisper_timestamp timestamp text
1673514570146 12/01/2023, 10:09:33 12/01/2023, 10:09:30 A
1673516761013 12/01/2023, 10:46:03 12/01/2023, 10:46:01 B
1673517063622 13/01/2023, 09:52:41 12/01/2023, 10:51:03 C
1673517347444 13/01/2023, 09:57:28 12/01/2023, 10:55:47 D
1673521819673 12/01/2023, 12:10:21 12/01/2023, 12:10:19 E
1673521820173 12/01/2023, 12:10:27 12/01/2023, 12:10:20 F

As discussed with @cammellos, we should probably use timestamp instead of whisper_timestamp to display messages' datetime.

@caybro
Copy link
Member

caybro commented Jan 16, 2023

Latest master has this too; last 2 messages are out of order:
image

@osmaczko
Copy link
Contributor

Latest master has this too; last 2 messages are out of order: image

Where can I find these messages? Most likely the order is right but the datetime displayed is wrong, I would need to check the database to confirm.

@cammellos
Copy link
Contributor

Latest master has this too; last 2 messages are out of order: image

It's always good to differentiate order and timestamps, the two are only tangentially related, unix timestamps are not (and should not) be used for ordering or check for potential ordering, since clocks differ on different devices, we use lamport timestamps hinted by a unix timestamp for that (clock values are called). (Just a neatpick, but it's always good to make sure people reading not "in the known" don't get the wrong idea :) )

osmaczko added a commit that referenced this issue Jan 17, 2023
Covers the case, where timestamps are missynchronized:
```
clock: 0 timestamp: 31.12.2022 10:00:00
clock: 1 timestamp: 01.01.2023 23:59:30
clock: 2 timestamp: 01.01.2023 23:59:45
clock: 3 timestamp: 02.01.2023 00:00:05
clock: 4 timestamp: 02.01.2023 00:00:10
clock: 5 timestamp: 01.01.2023 23:59:55
```

Before, it would result in repeated labels:
```
clock: 0 timestamp: 31.12.2022 10:00:00
    LABEL: 1.01.2023
clock: 1 timestamp: 01.01.2023 23:59:30
clock: 2 timestamp: 01.01.2023 23:59:45
    LABEL: 2.01.2023
clock: 3 timestamp: 02.01.2023 00:00:05
clock: 4 timestamp: 02.01.2023 00:00:10
    LABEL: 1.01.2023
clock: 5 timestamp: 01.01.2023 23:59:55
```

fixes: #8962
jrainville added a commit that referenced this issue Jan 19, 2023
Covers the case, where timestamps are missynchronized:
```
clock: 0 timestamp: 31.12.2022 10:00:00
clock: 1 timestamp: 01.01.2023 23:59:30
clock: 2 timestamp: 01.01.2023 23:59:45
clock: 3 timestamp: 02.01.2023 00:00:05
clock: 4 timestamp: 02.01.2023 00:00:10
clock: 5 timestamp: 01.01.2023 23:59:55
```

Before, it would result in repeated labels:
```
clock: 0 timestamp: 31.12.2022 10:00:00
    LABEL: 1.01.2023
clock: 1 timestamp: 01.01.2023 23:59:30
clock: 2 timestamp: 01.01.2023 23:59:45
    LABEL: 2.01.2023
clock: 3 timestamp: 02.01.2023 00:00:05
clock: 4 timestamp: 02.01.2023 00:00:10
    LABEL: 1.01.2023
clock: 5 timestamp: 01.01.2023 23:59:55
```

fixes: #8962
iurimatias pushed a commit that referenced this issue Jan 19, 2023
Covers the case, where timestamps are missynchronized:
```
clock: 0 timestamp: 31.12.2022 10:00:00
clock: 1 timestamp: 01.01.2023 23:59:30
clock: 2 timestamp: 01.01.2023 23:59:45
clock: 3 timestamp: 02.01.2023 00:00:05
clock: 4 timestamp: 02.01.2023 00:00:10
clock: 5 timestamp: 01.01.2023 23:59:55
```

Before, it would result in repeated labels:
```
clock: 0 timestamp: 31.12.2022 10:00:00
    LABEL: 1.01.2023
clock: 1 timestamp: 01.01.2023 23:59:30
clock: 2 timestamp: 01.01.2023 23:59:45
    LABEL: 2.01.2023
clock: 3 timestamp: 02.01.2023 00:00:05
clock: 4 timestamp: 02.01.2023 00:00:10
    LABEL: 1.01.2023
clock: 5 timestamp: 01.01.2023 23:59:55
```

fixes: #8962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants