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

Ungrouping and re-saving included workflows can crash with a file access exception #1163

Closed
glopesdev opened this issue Nov 30, 2022 · 0 comments · Fixed by #1164
Closed
Labels
bug Something isn't working
Milestone

Comments

@glopesdev
Copy link
Member

glopesdev commented Nov 30, 2022

To reproduce:

  1. Create or load an include workflow in the Extensions folder
  2. Ungroup the included workflow and re-save it over the same file

Note the issue is more reproducible running a debug build inside VS but can still happen when running outside with a much lower probability.

The problem seems to be connected with the fix in #1134 where a read-only stream is opened on the workflow file for upgrade but never explicitly closed. Apparently wrapping the stream in a XmlReader class and disposing it is not sufficient for closing the original stream.

Stream workflowStream;
try { workflowStream = GetWorkflowStream(fileName); }
catch (SystemException) { workflowStream = null; }
if (workflowStream != null)
{
using var reader = XmlReader.Create(workflowStream);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant