Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Dup Nodes/Server Glitches?

by ww (Archbishop)
on Mar 17, 2010 at 11:32 UTC ( [id://829143]=pmdevtopic: print w/replies, xml ) Need Help??

Server glitches implicated in some dup posts? hasn't attracted much comment in the thread itself, but /me has received several private replies which seem to support the hypothesis therein.

In brief, my notion is that one symptom/by-product/whatever occuring when pm is overloaded/slowed-for-whatever-reason, users tend to experience inadvertent creation of dup posts.

Perhaps this note will intrigue a more highly skilled dev to confirm (and fix?) or refute my suspicion.

Replies are listed 'Best First'.
Re: Dup Nodes/Server Glitches?
by BrowserUk (Patriarch) on Mar 17, 2010 at 12:12 UTC

    I'm pretty certain that most of my duplicates arise as a result of the sequence:

    1. Click "create"
    2. Switch to another tab or program.
    3. Come back to PM a few seconds or minutes later and see the "Create" button, and assume that I must have forgotten to click it, and so click again.

    Basically, PM is so slow that the screen hasn't updated at all after many seconds or even minutes.

    A better solution than trying to detect duplicates, might be to ensure that the browser changes quickly. I'm not suggesting bigger servers or anything like that, but simply that something get sent back to the browser immediately, before the heavy work of processing the page is undertaken.

    I don't know enough about the PM server setup (or CGI or Apache or...) to know if that is possible, but playing with a local webserver, I found that if you print the html header immediately, and then do your processing and page generation, my browser (Opera), clears the tab and sets the busy icon, which would at least prevent the button being clicked again.

    Maybe index.pl could use rewrite tricks to display an intermediate page prior to getting down to the heavy stuff?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      To prevent clicking the submit button again, one could use a little bit of (client-side) Javascript. Some change to the page should happen when the onSubmit event triggers, something that happens on many other sites, too. Some sites simply disable the submit button, annoying all users with temporary network problems, because you simply can not re-submit the form after a network outage. Some other sites change the label of the button to something like "please wait ...". A third category of sites injects or unhides a little piece of HTML that overlays the page at least partly and either asks the user to wait or simply shows an animated "loading please wait" GIF.

      Monks without an enabled Javascript engine in the Browser would see no difference when the Javascript is done right, the other ones would see at least a faked sign of life.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        one could use a little bit of (client-side) Javascript.

        No thanks.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Dup Nodes/Server Glitches?
by Corion (Patriarch) on Mar 17, 2010 at 11:36 UTC

    As there is no "duplicate detection" hidden form field displayed with every form, submitting a form twice will create a second, identical node. There is a partial stopgap that tries to detect absolutely identical posts, but if there is a change, only a unique identifier per form (likely via openform could identify a duplicate submission. What we do once we detect a duplicate submission would be a second thing.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-29 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found