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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MKleisinger
Copy link

… 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

codecov bot commented May 19, 2021

Codecov Report

Merging #125 (5f460d7) into master (756dc26) will decrease coverage by 0.12%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
ExcelMapper/ExcelMapper.cs 94.55% <83.33%> (-0.21%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 756dc26...5f460d7. Read the comment docs.

@MKleisinger
Copy link
Author

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

@mganss
Copy link
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
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
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.

None yet

3 participants