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

Enable SDK to reattach large files to messages on retry #487

Conversation

mrashed-dev
Copy link
Contributor

Description

This PR enables the SDK to re-attach large files when trying to retry the same request body. If a file_path is provided with the attachment request and the file stream is closed, the SDK will attempt to reopen it. The helper function attach_file_request_builder will now set the file_path in the object, so if you're currently using that helper function, the attachment will be ready for reattachment.

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

if the file path is present and the file is closed, we can make a copy of the payload and try to re-open the file.
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 99.14%. Comparing base (8490435) to head (3d72f8b).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
lib/nylas/utils/file_utils.rb 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #487      +/-   ##
==========================================
- Coverage   99.85%   99.14%   -0.72%     
==========================================
  Files          24       24              
  Lines         681      700      +19     
==========================================
+ Hits          680      694      +14     
- Misses          1        6       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@atejada atejada left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@mrashed-dev mrashed-dev merged commit ff15a14 into main Sep 23, 2024
5 checks passed
@mrashed-dev mrashed-dev deleted the CUST-3137-v-3-ruby-sdk-retrying-after-failed-send-does-not-include-attachments branch September 23, 2024 18:30
@mrashed-dev mrashed-dev mentioned this pull request Sep 24, 2024
mrashed-dev added a commit that referenced this pull request Sep 24, 2024
# Changelog

## Added
* Added query support for folders (#492, #488)
* Added dependency on `ostruct` gem (#491, #489)
* Enable SDK to reattach large files to messages on retry (#487)

## Changed
* Downgraded `rest-client` to `2.0` for better compatibility (#490)
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.

2 participants