You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, while implementing the latest v7.x SDK, I noticed that I don't seem to get callbacks/results for operations if they fail due to an Access Manager issue (such as if Access Control is enabled, but no auth token or an invalid auth token was provided).
For example, let's say I initialize the Pubnub SDK and then try to get a channel group occupancy. I have this code:
PNConfiguration pnConfiguration = new PNConfiguration(new UserId(userId));
pnConfiguration.SubscribeKey = subKey;
pnConfiguration.PublishKey = pubKey;
pnConfiguration.Secure = true;
pubnub = new Pubnub(pnConfiguration);
pubnub.AddListener(new SubscribeCallbackExt(OnMessageResult, OnPresenceResult, OnStatusEvent));
//pubnub.SetAuthToken(authToken); // commented out to demonstrate the problem
pubnub.HereNow().ChannelGroups(new string[] { "someChannelGroupName" }).IncludeState(false).IncludeUUIDs(false)
.Execute(new PNHereNowResultEx((result, status) => {
if(status.Error)
{
OutputErrorInfo(status);
}
else
{
// Process data as needed
}
}));
The problem is that the callback provided to "Execute" doesn't ever fire if you don't provide a valid auth token. I think the expected behavior is that the callback is fired, but the status.Error boolean would be true, and any other error message fields would be populated.
This is also a problem for operations that don't explicitly take a callback in their Execute() functions. For example, when subscribing to a channel, the "OnStatusEvent" callback is never executed when this issue occurs, even though (again) I'd expect it to be called with the status.Error to be set to true with any other error info.
If I enable PubNub's verbose logging to a file, I see that the system appears to be detecting that these calls are failing due to the Access Manager, but then I never receive callbacks so my code knows that these calls failed:
Hello, while implementing the latest v7.x SDK, I noticed that I don't seem to get callbacks/results for operations if they fail due to an Access Manager issue (such as if Access Control is enabled, but no auth token or an invalid auth token was provided).
For example, let's say I initialize the Pubnub SDK and then try to get a channel group occupancy. I have this code:
The problem is that the callback provided to "Execute" doesn't ever fire if you don't provide a valid auth token. I think the expected behavior is that the callback is fired, but the
status.Error
boolean would be true, and any other error message fields would be populated.This is also a problem for operations that don't explicitly take a callback in their
Execute()
functions. For example, when subscribing to a channel, the "OnStatusEvent" callback is never executed when this issue occurs, even though (again) I'd expect it to be called with thestatus.Error
to be set to true with any other error info.If I enable PubNub's verbose logging to a file, I see that the system appears to be detecting that these calls are failing due to the Access Manager, but then I never receive callbacks so my code knows that these calls failed:
The text was updated successfully, but these errors were encountered: