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

Comet, Comet on the Wall: Fix comets sent down via AJAX from within a comet #1646

Merged
merged 5 commits into from
Jan 15, 2015

Commits on Dec 9, 2014

  1. Move comet commands into S.jsToAppend.

    We do this because jsToAppend is referenced in a few
    different places, and it’s better to reuse it than to try and add
    commandForComets to all of those places (especially since
    some of them are inside CometActors, for example).
    Shadowfiend committed Dec 9, 2014
    Configuration menu
    Copy the full SHA
    a5125bc View commit details
    Browse the repository at this point in the history
  2. Don't lose jsToAppend during comet AJAX request.

    When dealing with an AJAX request in a comet context, we
    were partial-updating jsToAppend at the beginning of the
    request, but any updates that might have been made to it
    during the request processing were lost. We now send the
    partial update message after the request functions have run,
    so that any JS they’ve appended also gets sent down to the
    client.
    Shadowfiend committed Dec 9, 2014
    Configuration menu
    Copy the full SHA
    3617846 View commit details
    Browse the repository at this point in the history
  3. Avoid duplicate requests for comet-sourced comets.

    If a comet was sent down from within a comet context, we
    would force a comet request reset. On the client, this would
    schedule a new comet request and attempt to abort the old
    one; however, there is no way to abort the old one, since its
    success handler is what is kicking off this request reset.
    
    The end result is that the request’s success handler finished
    running, which would also schedule a new comet request,
    and we’d get two comet requests running in parallel and
    walking all over each other.
    
    When generating the comet commands, we now check to
    see if we’re executing in a comet context, and if we are we
    ask the client not to reset the comet cycle, knowing that the
    response we’re currently sending will immediately kick off a
    new request once it’s done executing.
    Shadowfiend committed Dec 9, 2014
    Configuration menu
    Copy the full SHA
    48e1e05 View commit details
    Browse the repository at this point in the history
  4. Handle comet send-down in partialUpdate.

    We now pull jsToAppend handling out of the message
    handler for comet-context AJAX request processing all the
    way to the wrapper around handling all messages. This
    ensures that things like partial updates will properly render
    their JS to append.
    
    It also seems to incidentally fix S.jsToAppend within comet
    rendering, which seemed to trigger the JS twice instead of
    just once before this.
    Shadowfiend committed Dec 9, 2014
    Configuration menu
    Copy the full SHA
    78ada31 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2015

  1. Slight style cleanup.

    Shadowfiend committed Jan 14, 2015
    Configuration menu
    Copy the full SHA
    afb8197 View commit details
    Browse the repository at this point in the history