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 basic support for attachments #1082

Merged
merged 53 commits into from
Dec 7, 2020
Merged

Conversation

philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Dec 1, 2020

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Add basic support for attachments.

💡 Motivation and Context

💚 How did you test it?

Unit tests and with a sample project.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

* @throws IOException an IOException
*/
@Override
public void serialize(final @NotNull SentryEnvelope envelope, final @NotNull Writer writer)
throws Exception {
public void serialize(SentryEnvelope envelope, OutputStream stream) throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public void serialize(SentryEnvelope envelope, OutputStream stream) throws Exception {
public void serialize(final @NotNull SentryEnvelope envelope, final @NotNull OutputStream stream) throws Exception {

M: double-check if there are more missing.

Copy link
Contributor

Choose a reason for hiding this comment

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

H: not sure if it's possible to use, as the OutputStream comes from the connection, but BufferedOutputStream exists

Copy link
Contributor

Choose a reason for hiding this comment

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

H: I'd rename to outputStream as inputStream also exists.

writer.write(buffer, 0, charsRead);
}
}
for (SentryEnvelopeItem item : envelope.getItems()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for (SentryEnvelopeItem item : envelope.getItems()) {
for (final SentryEnvelopeItem item : envelope.getItems()) {

*/
@NotNull
List<Attachment> getAttachments() {
return attachments;
Copy link
Member

Choose a reason for hiding this comment

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

Here we need to return a new instance of a list instead of our private one

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

Lets chips and iterate! 🚀

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.

4 participants