Skip to content

Commit

Permalink
Merge pull request #1902 from ably/ECO-4706/fix-typo
Browse files Browse the repository at this point in the history
fix: typo in deregistration error check condition
  • Loading branch information
umair-ably authored Apr 4, 2024
2 parents 5c0977a + aee22d7 commit 91fd2fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/ARTPushActivationStateMachine.m
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ - (void)deviceUnregistration:(ARTErrorInfo *)error {
[delegate ablyPushCustomDeregister:error deviceId:local.id callback:^(ARTErrorInfo *error) {
if (error) {
// RSH3d2c1: ignore unauthorized or invalid credentials errors
if (error.code == 401 || error.code == 40005) {
if (error.statusCode == 401 || error.code == 40005) {
[self sendEvent:[ARTPushActivationEventDeregistered new]];
} else {
[self sendEvent:[ARTPushActivationEventDeregistrationFailed newWithError:error]];
Expand All @@ -359,7 +359,7 @@ - (void)deviceUnregistration:(ARTErrorInfo *)error {
[_rest executeRequest:request withAuthOption:ARTAuthenticationOn completion:^(NSHTTPURLResponse *response, NSData *data, NSError *error) {
if (error) {
// RSH3d2c1: ignore unauthorized or invalid credentials errors
if (error.code == 401 || error.code == 40005) {
if (response.statusCode == 401 || error.code == 40005) {
ARTLogError(self->_logger, @"%@: unauthorized error during deregistration (%@)", NSStringFromClass(self.class), error.localizedDescription);
[self sendEvent:[ARTPushActivationEventDeregistered new]];
} else {
Expand Down

0 comments on commit 91fd2fd

Please sign in to comment.