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

feat: Add Bugsnag.getMetadata() #459

Merged

Conversation

robinmacharg
Copy link
Contributor

Goal

Provide metadata retrieval from the global Bugsnag class.

Design

A class method was added to the Bugsnag class, exposed appropriately to Swift. Equivalent lower-level methods were renamed to align them with the implemented method. The functionality was changed from "create if not available" to "return nil if not available".

Changeset

Bugsnag and BugsnagMetadata, along with appropriate unit test files.

Tests

Unit tests were provided in Objective C (and Swift to confirm name exposure).

Review

Outstanding Questions

  • This pull request is ready for:
    • Initial review of the intended approach, not yet feature complete
    • Structural review of the classes, functions, and properties modified
    • Final review
  • The correct target branch has been selected (master for fixes, next for
    features)
  • Consistency across platforms for structures or concepts added or modified
  • Consistencyxbetween the changeset and the goal stated above
  • Internal consistency with the rest of the library - is there any overlap between existing interfaces and any which have been added?
  • Usage friction - is the proposed change in usage cumbersome or complicated?
  • Performance and complexity - are there any cases of unexpected O(n^3) when iterating, recursing, flat mapping, etc?
  • Concurrency concerns - if components are accessed asynchronously, what issues will arise
  • Thoroughness of added tests and any missing edge cases
  • Idiomatic use of the language

@robinmacharg robinmacharg force-pushed the robinmacharg/Add-Bugsnag.getMetadata_section branch from db3c507 to 24ab3bd Compare February 10, 2020 15:51
@robinmacharg robinmacharg marked this pull request as ready for review February 10, 2020 16:39
Copy link
Contributor

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

I had a few queries about whether we need to implement additional methods for manipulating metadata that are listed in the spec. What has been implemented looks good - I left a few comments inline, some of which are more queries about how Objective-C works.

One thing to note is that the objective-c-ios example app still seems to be using event.metaData and therefore fails to compile, so it'd be worth checking that doesn't affect any of the other example apps.

Source/Bugsnag.h Show resolved Hide resolved
Source/Bugsnag.h Show resolved Hide resolved
Source/BugsnagMetadata.m Outdated Show resolved Hide resolved
Source/BugsnagMetadata.m Outdated Show resolved Hide resolved
iOS/BugsnagTests/Swift Tests/BugsnagMetadataTests.swift Outdated Show resolved Hide resolved
Tests/BugsnagTests.m Show resolved Hide resolved
@robinmacharg
Copy link
Contributor Author

robinmacharg commented Feb 11, 2020

Thanks for the detailed feedback - dealt with individually inline.

One thing to note is that the objective-c-ios example app still seems to be using event.metaData and therefore fails to compile

This is an easy one to miss (it's not the first time I have). There's a larger piece of work needing to be done to unify the three Apple platforms in a single project which will simplify the burden going forwards. The original reason for the separation (Carthage issues) has been resolved.

For now I'll update the PR template, adding an explicit check for the example app (as well as fixing the example apps).

- Also amend lower-level equivalent functionality to match (i.e. return nil on non-existence)
- Added a OOM metadata test
- Updated the example applications to support the BugsnagConfiguration's designated initializer and include the README within the project.
@robinmacharg robinmacharg force-pushed the robinmacharg/Add-Bugsnag.getMetadata_section branch from 24ab3bd to f4b69a9 Compare February 11, 2020 17:29
- Also amend lower-level equivalent functionality to match (i.e. return nil on non-existence)
- Added a OOM metadata test
- Updated the example applications to support the BugsnagConfiguration's designated initializer and include the README within the project.
….com:bugsnag/bugsnag-cocoa into robinmacharg/Add-Bugsnag.getMetadata_section

# Conflicts:
#	Source/BugsnagMetadata.h
#	Source/BugsnagMetadata.m
@robinmacharg robinmacharg force-pushed the robinmacharg/Add-Bugsnag.getMetadata_section branch from fd2d660 to ac0775d Compare February 12, 2020 14:30
@robinmacharg robinmacharg force-pushed the robinmacharg/Add-Bugsnag.getMetadata_section branch from ac0775d to 754879b Compare February 12, 2020 14:36
@robinmacharg robinmacharg merged commit 847a8b1 into spec-compliance Feb 12, 2020
@robinmacharg robinmacharg deleted the robinmacharg/Add-Bugsnag.getMetadata_section branch February 13, 2020 05:43
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