Skip to content

It it duplicating the self messages after refreshing the window in examples/private messages #5340

Open
@MeeeeetShah

Description

@MeeeeetShah

Describe the bug
It it duplicating the self messages after refreshing the window in examples/private messages

To Reproduce

Go through examples and take pull from 4th (final branch) for example/private message if we send message to self then it seems to be correct but after refreshing the window we see duplicating the self messages..

Socket.IO server version: 3.1.2

Server

import { Server } from "socket.io";

const io = new Server(3000, {});

io.on("connection", (socket) => {
  console.log(`connect ${socket.id}`);

  socket.on("disconnect", () => {
    console.log(`disconnect ${socket.id}`);
  });
});

Socket.IO client version: 4.8.1

Client

import { io } from "socket.io-client";

const socket = io("ws://localhost:3000/", {});

socket.on("connect", () => {
  console.log(`connect ${socket.id}`);
});

socket.on("disconnect", () => {
  console.log("disconnect");
});

Expected behavior
It should show single message only

Metadata

Metadata

Assignees

No one assigned

    Labels

    to triageWaiting to be triaged by a member of the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions