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

Add highlights summary to bug report attachment #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NickEntin
Copy link
Collaborator

Resolves #119

@@ -103,6 +103,6 @@ typedef void (^ARKEmailBugReporterCustomPromptCompletionBlock)(ARKEmailBugReport
@property (nonatomic) BOOL attachesViewHierarchyDescription;

/// Returns an attachment containing the log messages. Defaults to a plain text attachment containing each log message formatted using the bug reporter's `logFormatter`.
- (nullable ARKBugReportAttachment *)attachmentForLogMessages:(nonnull NSArray<ARKLogMessage *> *)logMessages inLogStoreNamed:(nonnull NSString *)logStoreName;
- (nullable ARKBugReportAttachment *)attachmentForLogMessages:(nonnull NSArray<ARKLogMessage *> *)logMessages inLogStoreNamed:(nonnull NSString *)logStoreName numberOfErrorsInHighlights:(NSInteger)numberOfErrorsInHighlights;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a breaking change for AardvarkMailUI. We could potentially work around this, but I think we should go ahead and call this a breaking change, since there will be other breaking changes to follow (in making the log store be treated like any other attachment in the email bug reporter).

@@ -107,11 +110,13 @@ public final class LogStoreAttachmentGenerator: NSObject {
/// - parameter logMessages: The log messages to be included in the attachment.
/// - parameter logFormatter: The formatter with which to format the log messages.
/// - parameter logStoreName: The name of the log store from which the logs were collected.
@objc(attachmentForLogMessages:usingLogFormatter:logStoreName:)
/// - parameter numberOfErrorsInHighlights: The number of errors to include in the highlights for the log store.
@objc(attachmentForLogMessages:usingLogFormatter:logStoreName:numberOfErrorsInHighlights:)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a breaking change for Aardvark. This one would be fairly easy to work around (by creating a separate method, rather than adding a parameter with a default value). I could go either way on this one.

Copy link
Collaborator

Choose a reason for hiding this comment

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

2¢ For such a small change, I think the workaround is preferable.

@NickEntin NickEntin force-pushed the entin/highlights-summary branch 4 times, most recently from 19faefe to 81c7b23 Compare September 18, 2021 00:05
@NickEntin NickEntin marked this pull request as ready for review September 18, 2021 00:13
Copy link
Collaborator

@sethfri sethfri left a comment

Choose a reason for hiding this comment

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

LGTM. A few comments

Sources/AardvarkMailUI/ARKEmailBugReporter.h Outdated Show resolved Hide resolved
@NickEntin NickEntin force-pushed the entin/highlights-summary branch 2 times, most recently from cb141a7 to 67020d5 Compare December 22, 2023 00:51
@@ -124,10 +129,19 @@ public final class LogStoreAttachmentGenerator: NSObject {

let fileName = logsFileName(for: logStoreName, fileType: "txt")

let recentErrorSummary = logMessages
.lazy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Um, I'll be lazy: is .lazy doing anything here, given the isEmpty call just below? (I don't know!)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the lazy still reduces work cause it at least keeps it from doing the map past the prefix. I'm not 100% sure though, I might be overestimating the power of lazy. At the very least it doesn't seem to hurt anything.

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.

Provide a mechanism for surfacing highlights from attachments
3 participants