+
Skip to content

Data loss and corruption when editing included (non-main) .ink files contained in subsubfolders #946

Open
@BassWasTaken

Description

@BassWasTaken

Brief description

Changes are not saved or are corrupted, when editing files located in subsubfolder. Corruption often replaces or displaces middle sections of the file with shifted blocks of similar character length.

Steps To Reproduce

  1. Open or create a main .ink file, which includes 1 or more files contained in subfolders inside a subfolder
  2. Navigate to such an included file via Inky's sidebar.
  3. Make edits in the included file.
  4. Save the project (it does not matter if this is done in the edited file, the main file, or any other file).
  5. Close the project (and make sure ink is fully closed).
  6. Reopen the included file: observe corrupted or lost content, random line duplication/replacement, and possibly resulting compile errors.

Expected behavior

All edited files, regardless of whether they are the main document or not, should retain their changes correctly and not be corrupted on save.

Observed behavior

Upon saving the file in question, the behavior depends on whether the changes were additive or subtractive.
If the edited file is shorter now than it was before editing, attempting to save it will simply revert it back to its previous state.
If however the edited file is longer now than it was before editing, the result will be a file that looks like it was poorly merged from 2 different files. From what I have observed this can have several effects.
The file can contains all or most of the original content of the file pre-editing, followed by a repeat of the final n characters of that content, where n is the number of characters that you added.
The file can also contain first part of its old content, followed by the new content, followed by the rest of its old content if any.
Finally, a combination of this behaviour can also occur.

This regards changes made not in the main ink file (i.e. the file the user opened) but other, included .ink files (i.e. the ones you can reach by navigating the file browser in ink), and only applies to files that are located 2 folders deeper than the main file.

E.G:

In the following file structure:

- root/
    - main_file.ink
    - subfolder/
        - included_file_1.ink
        - subsubfolder/
            - included_file_2.ink //<- changes in this file are susceptible to data loss.

From opening the files with a plain text editor, I have been able to determine that the corruptions occur upon saving the file. (Rather than, say, upon reopening it with ink.)

known workarounds

The workarounds I've found so far that work are:

  • Limiting ourselves to 1 level of subfolder (or foregoing subfolders altogether).
  • Working directly in the files you want to change:
    1. Close the main file.
    2. Open the desired subfile you want to edit.
    3. Make your changes here (as if it were a main file).
    4. Save & close this file.
    5. Go back to the main file and observe the changes be retained correctly.

Environment:

Inky version: Confirmed in version 0.13, 0.14, and 0.15. Other versions not tested.

OS: Windows 11 Home, Version 10.0.26100 Build 26100. Also occurs on other machines, though all tested machines are Windows OS.

Additional context

No Git, Unity, or Godot usage during reproduction.

Clean files, not copy-pasted, newly written from scratch, on a drive not affected by any git repository or other version-control software that may be interfering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载