sgtaziz / WebMessage

A client for communicating with the WebMessage tweak on iOS. Send and receive messages from the comfort of your computer
72 stars 12 forks source link

[Bug] UI - Duplicated Messages #128

Closed astra-io closed 3 years ago

astra-io commented 3 years ago

Not sure why this happens, happens a bit after message says Delivered. Goes away when I refresh or reenter conversation.

image

sabogalc commented 3 years ago

Me too

shallax commented 3 years ago

Same problem - happens when scrolling up and down the list of chats rather than scrolling within a chat's text for me.

Anything to do with this? Seems to fetch the first 25 messages every time it's called. Also seems to be the last 25 messages that get duplicated for me.

cacheMessages () {
      if (!this.$store.state.cacheMessages) return
      if (this.$socket && this.$socket.readyState == 1) {
        for (let i = 0; i < this.chats.length; i++) {
          let chat = this.chats[i]
          this.sendSocket({ action: 'fetchMessages', data: {
              id: chat.personId,
              offset: `0`,
              limit: `25`
            }
          })
        }
      } else {
        setTimeout(this.cacheMessages, 1000)
      }
    },

Update: If I turn off message caching in the client options, the problem goes away. Definitely something to do with this.

sgtaziz commented 3 years ago

I'll push a quick patch for this issue soon before I finish my current release roadmap. Good find @shallax

sabogalc commented 3 years ago

The incidence is much lower than on 0.6.1, but I still get this bug on 0.6.2 Still broken PNG image

sgtaziz commented 3 years ago

Fixed with 0.7.0