Subscribe flow issue

SurrealGames
edited March 2015 in Photon Chat
I had thought that we can subscribe to additional chats at any time, but are seeing an issue where the initial Subscribe works, but subsequent subscribes fail.

Upon investigation, it looks like subscribeRequests is NOT cleaned up because HandleSubscribeResponseEvent(EventData eventData) handler is called but

HandleSubscribeResponse(OperationResponse operationResponse) is NOT being called by Photon. So when we cal Subscribe again, even though everything had worked to that point, the Subscribe call fails out at that point:

if (this.subscribeRequests != null)
{
// TODO: log error
return false;
}


This leaves us considering having to fully disconnect from Photon when updating the chat subscription list, which is not very convenient -- or having to subscribe to a superset of topics and then filter internally, which is also not ideal.

Are we missing something here or is this fixed in a future release?

Comments

  • we send operation response to SubscribeOperation only in case of error

    in all cases SubscribeResponseEvent are sent. So, please use HandleSubscribeResponseEvent.
  • Ilya, you're misunderstanding my issue, perhaps because I didn't clarify that I connect to the Photon Cloud.

    So I'm not making the decision to call either -- it is Photon code that is calling event -- and not operation -- and thus the internal subscribe list within Photon Chat classes is not cleaned up -- and that prevents future calls to Photon chat subscribe API from working.

    I'm saying this appears to be a bug within Photon Chat Subscribe flow
  • well, seems like expressed my self not very clear

    >>Upon investigation, it looks like subscribeRequests is NOT cleaned up because HandleSubscribeResponseEvent(EventData eventData) handler is called but
    >>HandleSubscribeResponse(OperationResponse operationResponse) is NOT being called by Photon.
    HandleSubscribeResponseEvent SHOULD BE called, and HandleSubscribeResponse should NOT be called. HandleSubscribeResponse is called only in case of error.

    if you try to subscribe second time to same channel, you will get again HandleSubscribeResponseEvent
  • Ilya,

    I'm attempting to subscribe to a new channel. The call fails here, inside the Photon API.

    if (this.subscribeRequests != null)
    {
    // TODO: log error
    return false;
    }


    I cannot see how you can possibly subscribe to a new channel (after initial Subscribe) with the Photon code as written -- it always fails there. Is subscribing to a new channel on demand supported? Have you tried this test case? Subscribe to a couple of channels, then subscribe to another channel in a separate call?
  • >> I cannot see how you can possibly subscribe to a new channel (after initial Subscribe) with the Photon code as written -- it always fails there.
    it is difficult to understand why it fails for you and works for others. Probably we should take a look at your code, how do you do this. our client developer will check that you do everything correctly

    >>Is subscribing to a new channel on demand supported? Have you tried this test case?
    here i do not understand what you mean
    >>Subscribe to a couple of channels, then subscribe to another channel in a separate call?
    yes, this all should work
  • It looks like you use an older version of the Chat API. The subscribeRequests are gone in my version and the workflow has been revised.
    As far as I can see, the SDKs of v4.0.0.4 don't use subscribeRequests, so please update your Chat API with one of those SDKs.
    Download: https://www.exitgames.com/OnPremise/Download