Permalink
Commits on Aug 5, 2012
  1. Removed the assumption that the NSURLResponse we get back is a

    NSHTTPURLResponse, since in some cases it might not be. Such as if we're
    using a local (within-app) authentication url based on NSURLProtocol.
    committed Aug 5, 2012
Commits on Jun 21, 2012
  1. Build up a list of bindings to remove, then remove them, to avoid

    modifications to the nested arrays while they are being iterated over.
    lukeredpath committed Jun 21, 2012
Commits on Jun 11, 2012
  1. Improve the errors returned by channel authorisation, especially for

    non-dictionary and non-valid JSON responses.
    
    Also need to make sure we set isAuthorized back to NO if there is an
    error.
    lukeredpath committed Jun 11, 2012
  2. Don't wrap authorisation errors as the are already wrapped in a domain

    specific error, just create an unknown error if we aren't authorised
    and don't have an error.
    lukeredpath committed Jun 11, 2012
Commits on Jun 7, 2012
  1. Replace the client event buffer with an operation queue that is suspe…

    …nded
    
    while the channel is unsubscribed.
    lukeredpath committed Jun 7, 2012
  2. Wait for the test helper delegate to indicate we are no longer connected

    before continuing to the next spec.
    
    Also unsubscribe when we are done.
    lukeredpath committed Jun 7, 2012
  3. Fixed pragma doc.

    lukeredpath committed Jun 7, 2012
  4. Switch channel internal bindings to use block-based callbacks.

    The previous target/action bindings were causing a retain cycle between
    the binding (target/action proxy) and the channel.
    
    By using blocks with weak references to the channel, the blocks act as
    weak proxies to the channel, and the retain cycle is broken.
    lukeredpath committed Jun 7, 2012
Commits on Jun 4, 2012
  1. Revert "Cache channel authentication data."

    This reverts commit 1b92f78.
    lukeredpath committed Jun 4, 2012
  2. Cache channel authentication data.

    This avoids the need to make another authorisation request when reconnecting
    to an existing channel.
    lukeredpath committed Jun 4, 2012
Commits on May 29, 2012
  1. Because auto-reconnect happens after a delay, we should check that

    auto reconnect hasn't been disabled in the meantime before actually
    proceeding with the connection.
    lukeredpath committed May 29, 2012
  2. Cancel all outstanding auth operations if the connection is closed.

    All auth requests are specific to a connection as they use the socket
    ID returned from Pusher - once that socket ID has gone away, the auth
    operations can never be successful.
    lukeredpath committed May 29, 2012
  3. Add proper cancellation support to channel auth operations.

    If we want to cancel an auth operation, even if that request has 
    completed, we do not want to notify the delegate - we should just 
    ignore the response.
    
    We should also check for cancellation right at the start of the
    operation before running the URL request.
    lukeredpath committed May 29, 2012
Commits on May 24, 2012
Commits on May 17, 2012
  1. Ensure we don't try and subscribe to private channels when disconnected.

    We already check that we are connected before beginning the subscription
    process, but where that process is asynchronous and non-immediate, in
    the case of private/presence channels (because we have to run the
    authorisation operation first), we should check that we are still 
    connected again before finalising the subscription process.
    lukeredpath committed May 17, 2012
  2. Wait until the handshake is received before notifying the client dele…

    …gate
    
    that the connection is open.
    
    Track this internally using an enum to track state rather than a simple
    boolean flag.
    
    This reverts old the old behaviour where the socketID would be available
    within the didConnect delegate call.
    
    See #47.
    lukeredpath committed May 17, 2012
  3. Allow calls to [channel unsubscribe] when disconnected without crashing.

    Normally, we would always attempt to send an unsubscribe message but
    if we are disconnected, this will cause an assertion error.
    
    Because we always mark channels as unsubscribed when the connection 
    closes, it isn't necessary to send an unsubscribe message in this state.
    
    Instead of attempting to send the unsubscribe (which causes the assertion
    error), simply return without doing anything.
    
    Closes #46.
    lukeredpath committed May 17, 2012
Commits on May 15, 2012
  1. Make sure we always handle socket connection failures like any other

    type of disconnection.
    
    When SocketRocket's connection fails, we won't always receive the
    'didDisconnect' connection delegate method - sometimes we will receive
    the 'didFail' method.
    
    If we get the 'didFail' method, we'll pass that on to the Pusher delegate
    whether we were already connected or not.
    
    If we were already connected, then now it will also call the 'didDisconnect'
    delegate method.
    
    I've updated the connection monitor sample to account for this new behaviour.
    
    This should also fix #48.
    lukeredpath committed May 15, 2012
Commits on May 11, 2012
  1. Make header public

    lukeredpath committed May 11, 2012
  2. Delegating to the same socket delegate methods that would be called

    using a real socket means that the mock connection behaves more like
    a real connection, including calling its own delegate.
    lukeredpath committed May 11, 2012
  3. Introduce a mock connection object that can be used to make testing of

    PTPusher much easier for end users.
    lukeredpath committed May 11, 2012