Camunda-modeler: Wrong file extension on saving new cmmn diagram

Created on 13 Feb 2019  路  5Comments  路  Source: camunda/camunda-modeler

__Describe the Bug__

When trying to save a newly created CMMN diagram, it shows the wrong _xml_ file extension inside the save file dialog.

feb-13-2019 14-16-51

__Steps to Reproduce__

Steps to reproduce the behavior:

  1. Create new CMMN diagram
  2. Save it
  3. Save file dialog appears with wrong file xml extension

__Expected Behavior__

Save file dialog should show ${fileName}.cmmn as correct file type

__Environment__

Please complete the following information:

  • OS: MacOS 10.14
  • Camunda Modeler Version: 3.0.0-beta.0

__Summary of Debugging / Next steps to do__

CMMN backlog bug Darwin

All 5 comments

After further debugging, it came clear that the filters we put into the electronDialog.ShowSaveFileDialog might cause it. Right now I can't find any differences between the parameters on bpmn/dmn files (which are working as expected) and the broken cmmn procedure.

It worked back again in the last stable version v2.2.4.

Can anyone verify whether this behavior is showing up on Linux or Windows? @mschoe @nikku

Works on Linux.

Summary for debugging

The problem is caused by this line inside the dialog.js implementation. We introduced the removal of the file extension in our last dialog refactoring.

For macOS, there are a couple of environment implementations on how the save-dialog is opened inside electron. Firstly, it tries to grab the file extension from the defaultPath property which fits into one extension inside the filters. If not, which is our case since we remove the file extension from the path, it will try to get one extension from the filters. Unfortunately, this does not have to be the first entry inside the extensions array:

https://github.com/electron/electron/issues/9455#issuecomment-304387871

The order in which extensions are passed is not respected as it is being stored in set in an intermediate step

Therefore in the case of cmmn it always takes the xml file extension to be displayed.

Solution

In our last stable version v2.2.4 we didn't remove the file extension before opening the dialog. Simply removing the line will not work, since other save actions are also using the same functionality, e.g., the jpg export.

More investigation needed to find a proper solution.

Thanks for investigating. Let us pull it out of the current milestone then.

Was this page helpful?
0 / 5 - 0 ratings