Skip to content

The SaveAsync taking a stream is failing because the Workbook.Save is…#125

Open
MKleisinger wants to merge 1 commit intomganss:masterfrom
MKleisinger:hotfix/stream-write-disposal-error
Open

The SaveAsync taking a stream is failing because the Workbook.Save is…#125
MKleisinger wants to merge 1 commit intomganss:masterfrom
MKleisinger:hotfix/stream-write-disposal-error

Conversation

@MKleisinger
Copy link
Copy Markdown

… closing the created memory stream before it can copy the data into the users passed in stream. Adding a memory stream overriding close will fix this issue.

… closing the created memory stream before it can copy the data into the users passed in stream. Adding a memory stream overriding close will fix this issue.
@codecov
Copy link
Copy Markdown

codecov bot commented May 19, 2021

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.67%. Comparing base (756dc26) to head (5f460d7).
⚠️ Report is 261 commits behind head on master.

Files with missing lines Patch % Lines
ExcelMapper/ExcelMapper.cs 83.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
- Coverage   93.79%   93.67%   -0.13%     
==========================================
  Files           9        9              
  Lines        1193     1201       +8     
  Branches      171      172       +1     
==========================================
+ Hits         1119     1125       +6     
- Misses         47       48       +1     
- Partials       27       28       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MKleisinger
Copy link
Copy Markdown
Author

Tests are failing because the implemented non-closing stream is not being closed in any tests.

@mganss
Copy link
Copy Markdown
Owner

mganss commented May 20, 2021

I can't repro the failure. The MemoryStream's buffer is still available after it is closed. See this answer at StackOverflow: https://stackoverflow.com/a/3981274/1970064

@MKleisinger
Copy link
Copy Markdown
Author

MKleisinger commented Jul 8, 2021

The way I was able to repro it was to attempt to write the stream to an excel file. The excel file would be created; however, the worksheet was blank. When debugging I noticed that the stream had already been closed.

@mganss
Copy link
Copy Markdown
Owner

mganss commented Jul 9, 2021

Can you post a code snippet that shows the issue?

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.

3 participants