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

[PLAT-5503] Fix app version reported for crashes before v6.2.3 #911

Merged
merged 4 commits into from
Nov 30, 2020

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented Nov 26, 2020

Goal

Fixes an issue whereby crash reports written by earlier releases of Bugsnag (prior to v6.2.3) would be sent to the dashboard with invalid app version information in the payload.

Design

The root cause was that -[BugsnagEvent initWithKSCrashData:] was passing the current configuration to -[BugsnagAppWithState appWithDictionary:config:codeBundleId:], and the app version information therein was being used in preference to the information written by KSCrash (e.g. system[@"CFBundleVersion"]) when user.config did not contain any values (which was the case until v6.2.3 / #862.)

Changeset

-[BugsnagEvent initWithKSCrashData:] now creates a BugsnagConfiguration object initialized with the metadata config JSON written by BugsnagConfiguration in the crashing session.

-[BugsnagApp populateFields:] has been simplified - now that config corresponds to the config for the crashing vesion we no longer need to examine the values in user.config.

Testing

Manually verified by creating a crash report with Bugsnag 6.2.1 and then switching to this branch before building and running the app to send a report.

Some unit tests needed adjusting.

There are E2E test that validate that payloads contain the app versions specified in BugsnagConfiguration:

@nickdowell nickdowell force-pushed the nickdowell/fix-incorrect-version-numbers branch from bd24a03 to 41dcff8 Compare November 26, 2020 12:00
@nickdowell nickdowell marked this pull request as ready for review November 26, 2020 13:08
# Conflicts:
#	Tests/BugsnagConfigurationTests.m
@nickdowell nickdowell merged commit 0534b38 into next Nov 30, 2020
@nickdowell nickdowell deleted the nickdowell/fix-incorrect-version-numbers branch November 30, 2020 13:32
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