-
-
Notifications
You must be signed in to change notification settings - Fork 363
ref: SentryEnvelopeHeader to swift #5454
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
Merged
+113
−102
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import Foundation | ||
@_spi(Private) import Sentry | ||
@_spi(Private) @testable import SentryTestUtils | ||
import XCTest | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@_implementationOnly import _SentryPrivate | ||
|
||
@_spi(Private) @objc public final class SentryEnvelopeHeader: NSObject { | ||
/** | ||
* Initializes an @c SentryEnvelopeHeader object with the specified eventId. | ||
* @note Sets the @c sdkInfo from @c SentryMeta. | ||
* @param eventId The identifier of the event. Can be nil if no event in the envelope or attachment | ||
* related to event. | ||
*/ | ||
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.") | ||
@objc public convenience init(id eventId: SentryId?) { | ||
self.init(id: eventId, traceContext: nil) | ||
} | ||
|
||
/** | ||
* Initializes a @c SentryEnvelopeHeader object with the specified @c eventId and @c traceContext. | ||
* @param eventId The identifier of the event. Can be @c nil if no event in the envelope or | ||
* attachment related to event. | ||
* @param traceContext Current trace state. | ||
*/ | ||
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.") | ||
@objc public convenience init(id eventId: SentryId?, traceContext: TraceContext?) { | ||
self.init(id: eventId, sdkInfo: SentrySdkInfo.global(), traceContext: traceContext) | ||
} | ||
|
||
/** | ||
* Initializes a @c SentryEnvelopeHeader object with the specified @c eventId, @c skdInfo and | ||
* @c traceContext. It is recommended to use @c initWithId:traceContext: because it sets the | ||
* @c sdkInfo for you. | ||
* @param eventId The identifier of the event. Can be @c nil if no event in the envelope or | ||
* attachment related to event. | ||
* @param sdkInfo Describes the Sentry SDK. Can be @c nil for backwards compatibility. New | ||
* instances should always provide a version. | ||
* @param traceContext Current trace state. | ||
*/ | ||
@objc public | ||
init(id eventId: SentryId?, sdkInfo: SentrySdkInfo?, traceContext: TraceContext?) { | ||
self.eventId = eventId | ||
self.sdkInfo = sdkInfo | ||
self.traceContext = traceContext | ||
noahsmartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
@available(*, deprecated, message: "This is only marked as deprecated because enableAppLaunchProfiling is marked as deprecated. Once that is removed this can be removed.") | ||
@objc public static func empty() -> Self { | ||
Self(id: nil, traceContext: nil) | ||
} | ||
|
||
/** | ||
* The event identifier, if available. | ||
* An event id exist if the envelope contains an event of items within it are related. i.e | ||
* Attachments | ||
*/ | ||
@objc public var eventId: SentryId? | ||
@objc public var sdkInfo: SentrySdkInfo? | ||
@objc public var traceContext: TraceContext? | ||
noahsmartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* The timestamp when the event was sent from the SDK as string in RFC 3339 format. Used | ||
* for clock drift correction of the event timestamp. The time zone must be UTC. | ||
* | ||
* The timestamp should be generated as close as possible to the transmision of the event, | ||
* so that the delay between sending the envelope and receiving it on the server-side is | ||
* minimized. | ||
*/ | ||
@objc public var sentAt: Date? | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.