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

after pressing enter, the message is displayed two times #5

Open
ecarsmd opened this issue Sep 25, 2020 · 11 comments
Open

after pressing enter, the message is displayed two times #5

ecarsmd opened this issue Sep 25, 2020 · 11 comments

Comments

@ecarsmd
Copy link

ecarsmd commented Sep 25, 2020

when I send the "post" message, it is displayed two times
as in the following video - https://www.youtube.com/watch?v=pdMh7e4kO-M
do you know why this happens?

@e1sep0
Copy link

e1sep0 commented Oct 13, 2020

I have same problem, help please

@konshensx16
Copy link
Owner

Hello there, I'm so sorry I did not see the original post by @ecarsmd i just got notified now about this.

Please make sure that you are using the version that I used in the video, because they changed so much with the newer versions and they also removed the mechanism that sends the messages to a single target which is what is causing the message to be displayed twice.

The mercure version that I used was: ^0.2.3
The binary can be downloaded from here: https://github.com/dunglas/mercure/releases/tag/v0.10.0

If the problem persists please let me know

@e1sep0
Copy link

e1sep0 commented Oct 13, 2020

Hello, I took last mercure bundle: "symfony/mercure-bundle": "^0.2.5",
I made some changes in Message controller:

        $update = new Update(
            [
                sprintf("/conversations/%s", $conversation->getId()),
                sprintf("/conversations/%s", $recipient->getUser()->getUsername()),
            ],
            $messageSerialized
        );

And changes in Index Controller:

$token = (new Builder())
            ->withClaim('mercure', ['subscribe' => [sprintf("/conversations/%s", $username)]])
            ->getToken(
                new Sha256(),
                new Key($this->getParameter('mercure_secret_key'))
            )
        ;

Recipient get One message, But Sender views self message twice:
image

Maybe some problem in Vue files ? Thank you. mercury bundle 0.2.3 i can`t install unfortunately

@e1sep0
Copy link

e1sep0 commented Oct 13, 2020

I can leave only one topic in MessageController, but then updates only Left side (Recent)

@e1sep0
Copy link

e1sep0 commented Oct 13, 2020

I decided this problem, installed mercury 0.3.0. Thank you.
But got new one(
Sometimes page redirects after message sending, do you know why and how to fix it ?
Thanks a lot )

@konshensx16
Copy link
Owner

Hm that is really weird, which page do you get redirected to ? Also do you get redirect in the Vue app ? like the url changes ? or just when you take a look at the XHR request is says 302 redirected ?

@e1sep0
Copy link

e1sep0 commented Oct 14, 2020

After first message in chat pages refreshes, in profiler i see 301 redirect:
image
After this refresh chat works without this refreshing. Maybe something with auth?

@ecarsmd
Copy link
Author

ecarsmd commented Nov 4, 2020

I decided this problem, installed mercury 0.3.0. Thank you.
But got new one(
Sometimes page redirects after message sending, do you know why and how to fix it ?
Thanks a lot )

mercure-bundle 0.2.5 and mercure 0.3.0 ?

@e1sep0
Copy link

e1sep0 commented Nov 4, 2020

I decided this problem, installed mercury 0.3.0. Thank you.
But got new one(
Sometimes page redirects after message sending, do you know why and how to fix it ?
Thanks a lot )

mercure-bundle 0.2.5 and mercure 0.3.0 ?

"symfony/mercure": "^0.3",
"symfony/mercure-bundle": "^0.2.5",

@ecarsmd
Copy link
Author

ecarsmd commented Nov 5, 2020

I decided this problem, installed mercury 0.3.0. Thank you.
But got new one(
Sometimes page redirects after message sending, do you know why and how to fix it ?
Thanks a lot )

mercure-bundle 0.2.5 and mercure 0.3.0 ?

"symfony/mercure": "^0.3",
"symfony/mercure-bundle": "^0.2.5",

to me the problem persists (

@e1sep0
Copy link

e1sep0 commented Nov 11, 2020

to me the problem persists (

I found solution:
in assets/js/components/Right/Input.vue change line:
in form <form action="#"> add onsubmit event and remove action: <form onsubmit="event.preventDefault();">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants