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

Don't check session data contents if they are nil #1301

Merged
merged 2 commits into from
Feb 18, 2022

Conversation

kstenerud
Copy link
Contributor

Goal

When a session is resumed, we send an update notification with a nil object to indicate that there's no new session info to update:

    [center addObserver:self selector:@selector(sessionUpdateNotification:) name:BSGSessionUpdateNotification object:nil];

In our update handler, it fails the JSON check so the data doesn't get updated (as we want), but it also prints out an ominous error message:

if (![BSGJSONSerialization isValidJSONObject:notification.object]) {
    bsg_log_err("Invalid session payload in notification");
    return;
}

This PR does an explicit nil check so that it doesn't print an error message on session resume.

Testing

Reran e2e tests

@github-actions
Copy link

github-actions bot commented Feb 18, 2022

Bugsnag.framework binary size did not change - 913,280 bytes

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +48  +0.0%     +48    __TEXT,__text
  +0.2%      +8  +0.2%      +8    __TEXT,__unwind_info
  -0.2%     -56  -0.2%     -56    [__TEXT]
  [ = ]       0  [ = ]       0    TOTAL

Generated by 🚫 Danger

Bugsnag/BugsnagSystemState.m Outdated Show resolved Hide resolved
Copy link
Contributor

@nickdowell nickdowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it locally, LGTM 👍

@kstenerud kstenerud merged commit 2fb206a into next Feb 18, 2022
@kstenerud kstenerud deleted the karl-spurious-error-msg branch February 18, 2022 11:12
@nickdowell nickdowell mentioned this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants