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

🤖 Handle Unsupported Compression Methods in GZipStream Operations #192

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sentry-autofix[bot]
Copy link

@sentry-autofix sentry-autofix bot commented Apr 8, 2024

👋 Hi there! This PR was automatically generated 🤖

Triggered by bruno@sentry.io

Fixes ANDROID-SYMBOL-COLLECTOR-SERVER-68

The issue arises from an InvalidDataException during the decompression process in a GZipStream operation, indicating an unsupported compression method. To resolve this, we will implement a try-catch block around the GZipStream operation in the ProcessStreamedFile method of the SymbolsController. This will catch the InvalidDataException and log an appropriate error message, allowing the system to handle unsupported compression methods gracefully.

The steps that were performed:

  1. Implement try-catch for GZipStream operation

📣 Instructions for the reviewer which is you, yes you:

  • If these changes were incorrect, please close this PR and comment explaining why.
  • If these changes were incomplete, please continue working on this PR then merge it.
  • If you are feeling confident in my changes, please merge this PR.

This will greatly help us improve the autofix system. Thank you! 🙏

If there are any questions, please reach out to the AI/ML Team on #proj-autofix

🤓 Stats for the nerds:

Prompt tokens: 26409
Completion tokens: 1227
Total tokens: 27636

_logger.LogError(ex, "Unsupported compression method encountered.");
modelState.AddModelError("File", "Unsupported compression method.");
code = HttpStatusCode.UnsupportedMediaType;
return (null, null, code);
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this is right given there's a final return at the end for failure modes

Copy link
Member

Choose a reason for hiding this comment

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

Also CI is unhappy here, PR didn't take nullability into account:

/Users/runner/work/symbol-collector/symbol-collector/src/SymbolCollector.Server/SymbolsController.cs(337,28): error CS8619: Nullability of reference types in value of type '(string?, Stream?, HttpStatusCode? code)' doesn't match target type '(string fileName, Stream data, HttpStatusCode? code)'.

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.

1 participant