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

Pinning messages can go wrong with local room state desync #20035

Closed
anoadragon453 opened this issue Dec 3, 2021 · 10 comments
Closed

Pinning messages can go wrong with local room state desync #20035

anoadragon453 opened this issue Dec 3, 2021 · 10 comments
Labels
A-Message-Pinning O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Low/no impact on users T-Defect Z-Labs

Comments

@anoadragon453
Copy link
Member

Steps to reproduce

Doing the following:

  • Pin a message in the room
  • Unpin a different message (that I initially pinned) in the room.

...the timeline then looked like:

image

Outcome

The copy of these messages are inconsistent with one another. I would expect the first message to read more like:

anoa pinned a message from this room. See all pinned messages.

in order to match that of the unpinned message.

Operating system

Arch Linux

Application version

Element version: 1.9.5, Olm version: 3.2.3

How did you install the app?

Arch Linux repos

Homeserver

No response

Will you send logs?

No

@t3chguy
Copy link
Member

t3chguy commented Dec 3, 2021

The code claims to handle this correctly, the top state should show when there is more than 1 change happening at a time.

https://github.com/matrix-org/matrix-react-sdk/blob/ae0dba4e874834d050643ab5eb4e4fb6f929f339/src/TextForEvent.tsx#L523-L549

@anoadragon453 can you share the view source for the changed the pinned messages event (inc prev_content plz)

@t3chguy t3chguy added the X-Needs-Info This issue is blocked awaiting information from the reporter label Dec 3, 2021
@anoadragon453
Copy link
Member Author

Sure, here you are:

source of `changed the pinned messages` event
{
  "type": "m.room.pinned_events",
  "sender": "@andrewm:amorgan.xyz",
  "content": {
    "pinned": [
      "$Uvxqs5qV60FJqrM5YD7p0mcvKc_198Q12JjW83g6bUw",
      "$0qYG4_0L0npOqixy9EiZQoxaZPeNmLv-kMaarlE2Oy8"
    ]
  },
  "state_key": "",
  "origin_server_ts": 1638539585167,
  "unsigned": {
    "replaces_state": "$Rn0RQjL6qEl9h6icTsEqaUludKuLNcLITRnhiHL1aXE",
    "prev_content": {
      "pinned": [
        "$YILWYjC66FLdx5geGRSF1DfPSnzZOd3_eqOOi1GpF9Q",
        "$Uvxqs5qV60FJqrM5YD7p0mcvKc_198Q12JjW83g6bUw"
      ]
    },
    "prev_sender": "@andrewm:amorgan.xyz",
    "age": 219
  },
  "event_id": "$IvCi-rMCdrAb3_-XdO7yPbseKcDSzdRxz7rPkP6DXaw",
  "room_id": "!NiPbCUEXNokxKhTkeI:amorgan.xyz"
}

@anoadragon453
Copy link
Member Author

Note that I pinned the message by simply hitting: message menu -> pin.

Do you need client logs?

@t3chguy
Copy link
Member

t3chguy commented Dec 3, 2021

Client logs won't help here, your client's room local state fell out of sync at some point, likely not recently.
This could either be due to faulty /sync in Synapse or due to IndexedDB/js-sdk issues

@t3chguy t3chguy changed the title Pinned message state change notice text is inconsistent Pinning messages can go wrong with local room state desync Dec 3, 2021
@t3chguy
Copy link
Member

t3chguy commented Dec 3, 2021

In this instance, Anoa's local room state was not synced up with reality and their act of Pinning a message caused another to be unpinned due to their client not knowing that one was in fact pinned.

@t3chguy t3chguy removed the X-Needs-Info This issue is blocked awaiting information from the reporter label Dec 3, 2021
@anoadragon453
Copy link
Member Author

anoadragon453 commented Dec 3, 2021

Interestingly, $YILWYjC66FLdx5geGRSF1DfPSnzZOd3_eqOOi1GpF9Q is the event I then unpinned right afterwards...

The source of the unpinned state event is:

Source for the `unpinned a message` state event
{
  "type": "m.room.pinned_events",
  "sender": "@andrewm:amorgan.xyz",
  "content": {
    "pinned": [
      "$Uvxqs5qV60FJqrM5YD7p0mcvKc_198Q12JjW83g6bUw",
      "$0qYG4_0L0npOqixy9EiZQoxaZPeNmLv-kMaarlE2Oy8"
    ]
  },
  "state_key": "",
  "origin_server_ts": 1638539706218,
  "unsigned": {
    "replaces_state": "$IvCi-rMCdrAb3_-XdO7yPbseKcDSzdRxz7rPkP6DXaw",
    "prev_content": {
      "pinned": [
        "$YILWYjC66FLdx5geGRSF1DfPSnzZOd3_eqOOi1GpF9Q",
        "$Uvxqs5qV60FJqrM5YD7p0mcvKc_198Q12JjW83g6bUw",
        "$0qYG4_0L0npOqixy9EiZQoxaZPeNmLv-kMaarlE2Oy8"
      ]
    },
    "prev_sender": "@andrewm:amorgan.xyz",
    "age": 230
  },
  "event_id": "$xB_Oet_qqTHz3Z1tLGLifsZeLRzdTAaR4XOEqEvxkcE",
  "room_id": "!NiPbCUEXNokzKhTkeI:amorgan.xyz"
}

@anoadragon453
Copy link
Member Author

Also note that no other user/device has ever manipulated pinned messages in the room.

@germain-gg germain-gg added A-Message-Pinning O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Low/no impact on users labels Dec 6, 2021
@kittykat kittykat added the Z-Labs label Dec 8, 2021
@natrius
Copy link

natrius commented Feb 2, 2023

Question, do you need to activate something before its possible to pin a message? I tried on Desktop and on Android and its not possible.

@t3chguy
Copy link
Member

t3chguy commented Feb 2, 2023

@natrius this repo doesn't concern Android which is a separate codebase. On Web/Desktop it is behind Labs which needs to be enabled in config.json - such as it is on develop.element.io and Element Nightly

@anoadragon453
Copy link
Member Author

Pinned events have had a lot of development since this issue was reported. I'll open a new issue if I see the same behaviour.

@anoadragon453 anoadragon453 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Message-Pinning O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Low/no impact on users T-Defect Z-Labs
Projects
None yet
Development

No branches or pull requests

5 participants