Skip to content

Commit

Permalink
Use same timestamp for attachments as for error (#1722)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailSuendukov committed Dec 20, 2023
1 parent 1a47a87 commit 04ad240
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# App Center SDK for Android Change Log

## Version 5.0.5 (Under development)
w

### App Center Crashes

* **[Fix]** Synchronize the timestamp used for minidump attachments with the crash log's timestamp.

## Version 5.0.4

### App Center Distribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ public void run() {
dumpFile = new File(minidumpFilePath);
byte[] logfileContents = FileManager.readBytes(dumpFile);
dumpAttachment = ErrorAttachmentLog.attachmentWithBinary(logfileContents, "minidump.dmp", "application/octet-stream");
dumpAttachment.setTimestamp(errorLogReport.log.getTimestamp());
} else {
AppCenterLog.warn(LOG_TAG, "NativeException found without minidump.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1366,12 +1366,15 @@ public ManagedErrorLog answer(InvocationOnMock invocation) {
ManagedErrorLog log = mock(ManagedErrorLog.class);
when(log.getId()).thenReturn(UUID.randomUUID());
when(log.getException()).thenReturn(exception);
when(log.getTimestamp()).thenReturn(new Date());
return log;
}
});
when(logSerializer.serializeLog(any(Log.class))).thenReturn(jsonCrash);
when(SharedPreferencesManager.getBoolean(CRASHES_ENABLED_KEY, true)).thenReturn(true);

ErrorAttachmentLog errorAttachmentLog = mock(ErrorAttachmentLog.class);
when(ErrorAttachmentLog.attachmentWithBinary(any(), anyString(), anyString())).thenReturn(mock(ErrorAttachmentLog.class));
whenNew(ErrorAttachmentLog.class).withAnyArguments().thenReturn(errorAttachmentLog);

/* Start crashes. */
Expand Down

0 comments on commit 04ad240

Please sign in to comment.