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

Fixing a save bug that occurs when changing a request/folder name #14

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

Commits on Sep 22, 2021

  1. Fixing a save bug that occurs when changing a request/folder name

    If you were to save a workbook after changing a request or folder name, it would take the following actions:
    
    - Use the in-memory filesystem to create a workbook.json file with the details of the workbook.
    - Loop through the in-memory workbook's folders and requests, then create a file on the host filesystem.
    
    However, as a result, it ends up leaving the old (pre-renamed) request/folders on the filesystem, meaning the next time you load the workbook you end up with a duplicate.
    
    This patch changes this behavior by instead taking these actions:
    
    - Create a backup of the host filesystem's workbook files (workbook.json and all the folder/request JSONs) inside the .sgbackup
    - Delete the host filesystem's workbook files
    - Use the in-memory filesystem to create a workbook.json file with the details of the workbook.
    - Loop through the in-memory workbook's folders and requests, then create a file on the host filesystem.
    
    This seems to work, but in the future it might make sense to change this approach.
    
    The nice thing about this approach is that it should be possible to load directly from the backup if necessary.
    APIWT committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    879cd29 View commit details
    Browse the repository at this point in the history