Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-2654

Fix: 'replace' action while saving file

    Details

      Description

      *Problem persists 9.1.10. See comment.
      Testing is not yet finished. Something Rachel noticed is that the "Verify that a pop-up appears asking you to confirm if you would like to replace the file." test only works for file names with a file type in the name, not for just the name alone. The file will overwrite and save, but there will be no pop-up.

      *below is fixed*
      For example, saving a track as SaveFile, then saving another track as SaveFile in the same location does not produce a pop-up. It will replace the existing file.
      If I save a track as SaveFile.bed, then save another track as SaveFile.bed in the same location it will produce a pop-up.

        Attachments

          Issue Links

            Activity

            Hide
            ann.loraine Ann Loraine added a comment -

            As noted in https://jira.transvar.org/browse/IGBF-2608, This behavior is also found in version 9.1.4.

            Show
            ann.loraine Ann Loraine added a comment - As noted in https://jira.transvar.org/browse/IGBF-2608 , This behavior is also found in version 9.1.4.
            Hide
            rweidenh Logan Weidenhammer (Inactive) added a comment -

            Two problems on Windows 10:

            Saving a track with the same name and in the same place as an existing saved track will not result in a pop-up error message like it should, but will overwrite the original file.

            Saving a track with the same name and in the same place as an existing saved track but with the file type extension included in the name, like FileName.bed, will result in the appropriate pop-up error message. But clicking the "Yes, replace the file" option will result in a new file being created with two file type extensions in the name, like FileName.bed.bed, and will not overwrite the original file.

            Show
            rweidenh Logan Weidenhammer (Inactive) added a comment - Two problems on Windows 10: Saving a track with the same name and in the same place as an existing saved track will not result in a pop-up error message like it should, but will overwrite the original file. Saving a track with the same name and in the same place as an existing saved track but with the file type extension included in the name, like FileName.bed, will result in the appropriate pop-up error message. But clicking the "Yes, replace the file" option will result in a new file being created with two file type extensions in the name, like FileName.bed.bed, and will not overwrite the original file.
            Hide
            rweidenh Logan Weidenhammer (Inactive) added a comment - - edited

            Release Testing on Mac M1.
            This problem persists in 9.1.8 and 9.1.10 during release testing. Though the "second" problem from my previous comment: "Yes, replace file" is fixed now when the pop-up does appear.

            A pop-up asks to replace the file in the case of bookmarks. For example a bookmark.html file, but not for a track.bed file.

            To reproduce:
            1. Reset preferences by going to File > Preferences > Other Options > Reset Preferences to Defaults
            2. Open genome A_Thaliana Jun_2009
            3. Choose Araport track.
            4. Right click, then “Save track as…”
            5. Save as name: “test” with file type: bed to the desktop
            6. Repeat:
            7. Choose Araport track.
            8. Right click, then “Save track as…”
            9. Save as: “test” with file type: bed to the desktop
            10. Notice no request to replace file.
            11. On the desktop, right click test.bed
            12. Click Get Info
            13. Notice it is Modified today at this time. The file was replaced without asking.

            Release testing protocol found at: FileChooser, General Function Checklist. https://wiki.bioviz.org/confluence/display/ITD/FileChooser

            Show
            rweidenh Logan Weidenhammer (Inactive) added a comment - - edited Release Testing on Mac M1. This problem persists in 9.1.8 and 9.1.10 during release testing. Though the "second" problem from my previous comment: "Yes, replace file" is fixed now when the pop-up does appear. A pop-up asks to replace the file in the case of bookmarks. For example a bookmark.html file, but not for a track.bed file. To reproduce: 1. Reset preferences by going to File > Preferences > Other Options > Reset Preferences to Defaults 2. Open genome A_Thaliana Jun_2009 3. Choose Araport track. 4. Right click, then “Save track as…” 5. Save as name: “test” with file type: bed to the desktop 6. Repeat: 7. Choose Araport track. 8. Right click, then “Save track as…” 9. Save as: “test” with file type: bed to the desktop 10. Notice no request to replace file. 11. On the desktop, right click test.bed 12. Click Get Info 13. Notice it is Modified today at this time. The file was replaced without asking. Release testing protocol found at: FileChooser, General Function Checklist. https://wiki.bioviz.org/confluence/display/ITD/FileChooser
            Hide
            nfreese Nowlan Freese added a comment - - edited

            8.5.4 - Uses the non-native file chooser. If file name "test" entered then it adds the extension then makes the user click save again, then it checks if other file exists

            9.0.0 - Native file chooser used. Entering "test" or "test.bed" both ask if i want to replace file.

            9.0.2 - Native file chooser used. Entering "test" the file is overwritten without asking if I want to replace. Entering "test.bed" asks if I want to replace the file. This indicates that the regression took place between 9.0.0 and 9.0.2.

            Show
            nfreese Nowlan Freese added a comment - - edited 8.5.4 - Uses the non-native file chooser. If file name "test" entered then it adds the extension then makes the user click save again, then it checks if other file exists 9.0.0 - Native file chooser used. Entering "test" or "test.bed" both ask if i want to replace file. 9.0.2 - Native file chooser used. Entering "test" the file is overwritten without asking if I want to replace. Entering "test.bed" asks if I want to replace the file. This indicates that the regression took place between 9.0.0 and 9.0.2.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            This is a bug that was introduced in IGB 9.0.0 when we refactored to use the native file chooser. In 9.0.0 the behavior is correct when it asks the user if they would like to overwrite the file, but the filename is saved incorrectly as filename.bed.*.bed. This problem was attempted to be fixed but unfortunately the fix broke the logic for checking if the file already exists.

            Issue seems to be in the following files:

            AbstractExportFileAction - saveAsFile ->Look at line 96
            FileChooserUtil

            Other files that use FileChooserUtil.java -> saveFilesFromFxChooser:

            AbstractExportFileAction.java
            WebLInksView.java
            BookmarkManagerView.java
            ExportDialog.java
            SaveSessionAction.java
            Show
            nfreese Nowlan Freese added a comment - - edited This is a bug that was introduced in IGB 9.0.0 when we refactored to use the native file chooser. In 9.0.0 the behavior is correct when it asks the user if they would like to overwrite the file, but the filename is saved incorrectly as filename.bed.*.bed. This problem was attempted to be fixed but unfortunately the fix broke the logic for checking if the file already exists. Issue seems to be in the following files: AbstractExportFileAction - saveAsFile ->Look at line 96 FileChooserUtil Other files that use FileChooserUtil.java -> saveFilesFromFxChooser: AbstractExportFileAction.java WebLInksView.java BookmarkManagerView.java ExportDialog.java SaveSessionAction.java
            Hide
            nfreese Nowlan Freese added a comment - - edited

            The issue around saving files is related to many other tickets (see IGBF-1128) of which this ticket is effectively a clone of IGBF-1410.

            In AbstractExportFileAction.java in the saveAsFile method there is a call to make a new FileChooser.ExtensionFilter. According to the official Java documentation the way the filter works is by including a wildcard "*" in front of the desired filetypes (i.e. *.png). However, this wildcard was removed as part of IGBF-1128. This was done because the wildcard appeared to be added to the file extension when saved, causing issues. However, it appears to have had the unintended consequence of causing the Save File dialog box to behave incorrectly and fail to check if a file already exists.

            To fix the issue the wildcard needed to be included in AbstractExportFileAction.java. To fix the issue with the file extension, I removed what appeared to be an unneeded addition of the selectedExtension to the file path. There could be an edge case for why this logic was included, but after testing I have been unable to determine why it was there.

            See my previous comment regarding other classes that use FileChooserUtil.java. We will need to test saving both annotation and graph tracks, sessions, bookmarks, and weblinks. In addition, there was an issue with the file extensions appearing twice on windows that may also be related (IGBF-1162).

            Commit: https://bitbucket.org/nfreese/nowlanfork-igb/commits/e9392d022999e03423d450a018d97e136877ba8e

            Show
            nfreese Nowlan Freese added a comment - - edited The issue around saving files is related to many other tickets (see IGBF-1128 ) of which this ticket is effectively a clone of IGBF-1410 . In AbstractExportFileAction.java in the saveAsFile method there is a call to make a new FileChooser.ExtensionFilter. According to the official Java documentation the way the filter works is by including a wildcard "*" in front of the desired filetypes (i.e. *.png). However, this wildcard was removed as part of IGBF-1128 . This was done because the wildcard appeared to be added to the file extension when saved, causing issues. However, it appears to have had the unintended consequence of causing the Save File dialog box to behave incorrectly and fail to check if a file already exists. To fix the issue the wildcard needed to be included in AbstractExportFileAction.java. To fix the issue with the file extension, I removed what appeared to be an unneeded addition of the selectedExtension to the file path. There could be an edge case for why this logic was included, but after testing I have been unable to determine why it was there. See my previous comment regarding other classes that use FileChooserUtil.java. We will need to test saving both annotation and graph tracks, sessions, bookmarks, and weblinks. In addition, there was an issue with the file extensions appearing twice on windows that may also be related ( IGBF-1162 ). Commit: https://bitbucket.org/nfreese/nowlanfork-igb/commits/e9392d022999e03423d450a018d97e136877ba8e
            Hide
            nfreese Nowlan Freese added a comment -

            In addition, I also found a new bug where the selection of the output file type (bed or bed detail) does not appear to be consistent. Bed detail is sometimes saved when bed is selected and vice versa. I have created IGBF-3203 to fix this issue.

            Show
            nfreese Nowlan Freese added a comment - In addition, I also found a new bug where the selection of the output file type (bed or bed detail) does not appear to be consistent. Bed detail is sometimes saved when bed is selected and vice versa. I have created IGBF-3203 to fix this issue.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            Testing with Logan Weidenhammer we identified an existing issue (see IGBF-1184) with weblinks that is related to this issue. I was able to fix the issue in the following commit. Because the issues are closely related I think we can include it under 2654 as its own commit (i.e. we should not squash them together).

            https://bitbucket.org/nfreese/nowlanfork-igb/commits/8653e64c435b4f21e875a8713844871e0e6b8de5

            Show
            nfreese Nowlan Freese added a comment - - edited Testing with Logan Weidenhammer we identified an existing issue (see IGBF-1184 ) with weblinks that is related to this issue. I was able to fix the issue in the following commit. Because the issues are closely related I think we can include it under 2654 as its own commit (i.e. we should not squash them together). https://bitbucket.org/nfreese/nowlanfork-igb/commits/8653e64c435b4f21e875a8713844871e0e6b8de5
            Hide
            rweidenh Logan Weidenhammer (Inactive) added a comment -

            The two commits have been reviewed.
            Tested file saving for annotation tracks, graph tracks, sessions, bookmarks, weblinks, and image saving on Windows and Mac, 9.1.8 and 9.1.10.

            Dr. Freese fixed the existing weblinks issue where not choosing a file type would result in the file being replaced without asking.

            We wanted to note a previous issue on 9.1.8 where Windows would save double file extensions is resolved in 9.1.10, with the caveat that Windows' file saver still shows a double extension when in the process of saving a track. This does not actually cause the file to be saved with multiple extensions. This is not a regression in this new release.

            Recommending Pull Request.

            Show
            rweidenh Logan Weidenhammer (Inactive) added a comment - The two commits have been reviewed. Tested file saving for annotation tracks, graph tracks, sessions, bookmarks, weblinks, and image saving on Windows and Mac, 9.1.8 and 9.1.10. Dr. Freese fixed the existing weblinks issue where not choosing a file type would result in the file being replaced without asking. We wanted to note a previous issue on 9.1.8 where Windows would save double file extensions is resolved in 9.1.10, with the caveat that Windows' file saver still shows a double extension when in the process of saving a track. This does not actually cause the file to be saved with multiple extensions. This is not a regression in this new release. Recommending Pull Request.
            Show
            nfreese Nowlan Freese added a comment - Pull request: https://bitbucket.org/lorainelab/integrated-genome-browser/pull-requests/916/igbf-2654
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            Merged. Installers built for "master" branch. I have notarized the MacOS installer master.dmg and uploaded it to repository downloads section. I have also deployed the master branch installers to the IGB "early access" section of the bioviz.org web site.

            Ready for final testing.

            Show
            ann.loraine Ann Loraine added a comment - - edited Merged. Installers built for "master" branch. I have notarized the MacOS installer master.dmg and uploaded it to repository downloads section. I have also deployed the master branch installers to the IGB "early access" section of the bioviz.org web site. Ready for final testing.
            Hide
            rweidenh Logan Weidenhammer (Inactive) added a comment -

            I'm sorry I didn't catch this on the pre-merge testing.
            Windows allows saving sessions without a visible file extension, but IGB still understands what to do with it.

            I can choose to save a session, backspace over the ".xml" in the suggested file name (with XML indicated as the 'type' in the windows native file chooser, and then save it. It is saved without an extension as a generic file.
            Then when loading a session, the file does not show up in IGB Load-Session file chooser (issue present in 9.1.8 also), but you CAN load the saved session normally if you type in the file name.

            For example: files named savedSession and savedSession.xml are treated as unique files. Though IGB can still load the savedSesson (no extension) file normally.

            On Windows IGB 9.1.8 this particular issue is not present.

            All other types of saving worked normally.

            Show
            rweidenh Logan Weidenhammer (Inactive) added a comment - I'm sorry I didn't catch this on the pre-merge testing. Windows allows saving sessions without a visible file extension, but IGB still understands what to do with it. I can choose to save a session, backspace over the ".xml" in the suggested file name (with XML indicated as the 'type' in the windows native file chooser, and then save it. It is saved without an extension as a generic file. Then when loading a session, the file does not show up in IGB Load-Session file chooser (issue present in 9.1.8 also), but you CAN load the saved session normally if you type in the file name. For example: files named savedSession and savedSession.xml are treated as unique files. Though IGB can still load the savedSesson (no extension) file normally. On Windows IGB 9.1.8 this particular issue is not present. All other types of saving worked normally.
            Hide
            nfreese Nowlan Freese added a comment - - edited

            List of files that call FileChooser.ExtensionFilter:

            AbstractExportFileAction.java - fixed	
            RunScriptAction.java	- fixed
            SynonymsControlPanel.java	- fixed
            CustomGenomeDialogPanel.java - fixed
            WebLinksView.java	-fixed
            BookmarkManagerView.java	-fixed
            LoadSessionAction.java	-fixed
            SaveSessionAction.java	-fixed

            List of files that call saveFilesFromFxChooser

            AbstractExportFileAction.java	-fixed
            WebLinksView.java	-fixed
            BookmarkManagerView.java	-fixed
            ExportDialog.java	
            SaveSessionAction.java	-fixed

            Need to work on ExportDialog.java

            I've pushed a new commit to my 2654 branch that addresses an issue with sessions: https://bitbucket.org/nfreese/nowlanfork-igb/commits/4b2ae9ca13c4116b981bafb4a2eb72fa14929064

            Show
            nfreese Nowlan Freese added a comment - - edited List of files that call FileChooser.ExtensionFilter: AbstractExportFileAction.java - fixed RunScriptAction.java - fixed SynonymsControlPanel.java - fixed CustomGenomeDialogPanel.java - fixed WebLinksView.java -fixed BookmarkManagerView.java -fixed LoadSessionAction.java -fixed SaveSessionAction.java -fixed List of files that call saveFilesFromFxChooser AbstractExportFileAction.java -fixed WebLinksView.java -fixed BookmarkManagerView.java -fixed ExportDialog.java SaveSessionAction.java -fixed Need to work on ExportDialog.java I've pushed a new commit to my 2654 branch that addresses an issue with sessions: https://bitbucket.org/nfreese/nowlanfork-igb/commits/4b2ae9ca13c4116b981bafb4a2eb72fa14929064
            Hide
            nfreese Nowlan Freese added a comment -
            Show
            nfreese Nowlan Freese added a comment - I have fixed the ExportDialog.java file extension. Commit: https://bitbucket.org/nfreese/nowlanfork-igb/commits/7a6a8d907c3cc0be92114b93f51baf88d0c64462
            Hide
            rweidenh Logan Weidenhammer (Inactive) added a comment - - edited

            Commits reviewed.

            I tested on Windows saving images of all 3 file types as all 4 different views both with an without file extensions. All of them saved with the appropriate extensions, no files were created without extensions, and no files were created with double extensions.

            Recommending Pull Request.

            Show
            rweidenh Logan Weidenhammer (Inactive) added a comment - - edited Commits reviewed. I tested on Windows saving images of all 3 file types as all 4 different views both with an without file extensions. All of them saved with the appropriate extensions, no files were created without extensions, and no files were created with double extensions. Recommending Pull Request.
            Show
            nfreese Nowlan Freese added a comment - Pull request: https://bitbucket.org/lorainelab/integrated-genome-browser/pull-requests/917/igbf-2654
            Hide
            ann.loraine Ann Loraine added a comment -

            PR is merged and new master branch installers are built. Apple installer is notarized and uploaded to Downloads section of the IGB team repository. New installers are deployed to the "early access" section of the BioViz.org Web site.

            Ready for testing.

            Show
            ann.loraine Ann Loraine added a comment - PR is merged and new master branch installers are built. Apple installer is notarized and uploaded to Downloads section of the IGB team repository. New installers are deployed to the "early access" section of the BioViz.org Web site. Ready for testing.
            Hide
            rweidenh Logan Weidenhammer (Inactive) added a comment -

            Post-merge testing is complete. I tested the same functions as my previous comment as well as ran through the Image Export subsystem tests. Everything is working as intended.
            Moving to done.

            Show
            rweidenh Logan Weidenhammer (Inactive) added a comment - Post-merge testing is complete. I tested the same functions as my previous comment as well as ran through the Image Export subsystem tests. Everything is working as intended. Moving to done.

              People

              • Assignee:
                nfreese Nowlan Freese
                Reporter:
                ssegu Sai Supreeth Segu (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: