Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Posts appear twice when posting

Hi,

When posting a comment, it appears twice in the discussion (I assume because the plugin refreshes the view so you see the comment you just posted, and Vanilla by default displays it too without refreshing anything.)

Using Vanilla 2.1 :)

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    Does that happen every time when you post? I have made no check for that, indeed, but it never happened to me.
    It can only happen, if the comment has already been commited, before the commets get fetched. So the writing action has been performed much faster than the reading action? That would be strange. But in order to avoid that, I could implement a check for only displaying comments that have not been posted by the current user.

    But if anyone uses more than one browser window, that would lead to ugly updates, too.

    Could you please keep an eye on that behaviour and tell me if it happens always, often or only from time to time?

  • Based on my testing it consistently happens for the first post after signing in. The latter posts are displayed only once. If I log out, then log back in, and post, it happens again.

  • R_JR_J Ex-Fanboy Munich Admin

    I love reproducable errors! :)

    I'll take a look at that as soon as possible

  • R_JR_J Ex-Fanboy Munich Admin

    Sorry, @Accent, but I couldn't reproduce that by now. Either it is something exotic on your side or I'm just a lucky guy.

    If no one else will get the same feedback, I think I will not change anything but if I would, I would do something like that: put $PreviousCommentID = $CommentID at the end of the foreach loop and enclose the inner foreach code in an if clause like that: if ($CommentID != $PreviousCommentID) {...} (must start after $CommentID = ...)
    If you still have got the problem, you might try to solve it that way.

    By now I have an untested version v0.2 on GitHub which is optimized for boards with cache enabled. After I've tested it, I will update the version here. This version works with $Comments as an array, so it would be easy to simply add $Comments = array_unique($Comments) right before the foreach loop. I guess I'll add that before I upload v0.2 to addons section

  • peregrineperegrine MVP
    edited August 2014

    @R_J said:
    I love reproducable errors! :)

    I love reproducable reproducible errors as well (as in I in i and not a). :(>:)

    but I only speak one language, you guys amaze me how fluent you are. You polyglots.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • R_JR_J Ex-Fanboy Munich Admin

    Only two languages here... Although I've tried to learn Spanish some time ago, but I never got past those useless beginner sentences. I guess I'll never enter a room, look around and proudly announce: "Buenas noches - yo soy un hombre! La mujer bebe leche e yo come una manzana! :)"

  • peregrineperegrine MVP
    edited August 2014

    test to see if google translate can make a dry joke funny in another language :)

    A guy with a crocodile under his arm walks into a bar

    Guy with Crocodile says "Do you serve Software Developers"?
    Bartender says: "Sure, no problem"

    Guy with Crocodile says: "Ok, a beer for me, and a software developer for my crocodile."


    Un tipo con un cocodrilo bajo el brazo entra en un bar

    Individuo con el cocodrilo dice "¿Sirven los desarrolladores de software"?
    El camarero dice: "Claro, no hay problema"

    Individuo con el cocodrilo dice: "Ok, una cerveza para mí, y un desarrollador de software para mi cocodrilo."


    Ein Mann mit einem Krokodil unter dem Arm geht in eine Bar

    Guy mit Krokodil sagt: "Sie dienen Software-Entwickler"?
    Barkeeper sagt: "Klar, kein Problem"

    Guy mit Krokodil sagt: "Ok, ein Bier für mich, und ein Software-Entwickler für mein Krokodil."

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • R_JR_J Ex-Fanboy Munich Admin

    @peregrine said:
    Ein Mann mit einem Krokodil unter dem Arm geht in eine Bar

    Guy mit Krokodil sagt: "Sie dienen Software-Entwickler"?
    Barkeeper sagt: "Klar, kein Problem"

    Guy mit Krokodil sagt: "Ok, ein Bier für mich, und ein Software-Entwickler für mein Krokodil."

    The catch is that there are two different words for the different meanings of "serve" in German and that's why it cannot be translated literally and translation bots must fail ;)

    But if we're testing Google translate, I'll give it a poem: the only one that I know by heart. It is called "Ottos Mops" by Ernst Jandl:

    ottos mops

    ottos mops trotzt
    otto: fort mops fort
    ottos mops hopst fort
    otto: soso

    otto holt koks
    otto holt obst
    otto horcht
    otto: mops mops
    otto hofft

    ottos mops klopft
    otto: komm mops komm
    ottos mops kommt
    ottos mops kotzt
    otto: ogottogott


    Google fails completely - not even "mops" is translated all the time...

    ottos mops

    ottos mops defying
    otto: fort mops continue
    ottos mops continue hops
    otto: soso

    otto brings coke
    otto brings fruit
    otto listens
    otto: pug pug
    otto hopes

    ottos mops knocking
    otto: come come pug
    ottos mops comes
    ottos mops pukes
    otto: ogottogott

  • peregrineperegrine MVP
    edited August 2014

    @r_j here are some translations for Ottos Mops

    http://www.signandsight.com/features/290.html

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • businessdadbusinessdad Stealth contributor MVP

    @R_J said:
    I love reproducable errors! :)

    @R_J said:
    Sorry, Accent, but I couldn't reproduce that by now. Either it is something exotic on your side or I'm just a lucky guy.

    Ta-dah!

  • oh boy this thread has deviated quite a bit hasn't it

    @R_J‌, okay, I'll let you know if other users on my board report the same problem and I'll try the new version when it's released :)

  • Mine is doing the same thing. I post and it shows up twice; once as posted, and once as if I am still writing comment.

Sign In or Register to comment.