Skip to content

Extern Enum import not syncing properly (checksum null and false file modification flagged) #1205

@Hymenium

Description

@Hymenium

Issue: Importing an external Enum (.txt or .json) fails to correctly register the data in the project’s main definition list. The UI thinks it has the data, but it is not shown and the Project file is not marked as "UNSAVED". If it is saved anyway (ctrl + s) then the external Enum is present in the JSON with the correct relative path but the file checksum is null. When the Enum panel is reopened this causes a file modified flag to be falsely applied and syncing then causes an Enum duplication.

To replicate:

  • Load an external Enum.
  • Observe that it does not show immediately in the UI and the project is not marked "UNSAVED".
  • Optionally: Save the project and observe the null checksum in the resulting JSON.
  • Reopen the Enum panel, the Enum shows with the file modification warning.

Environment:
LDtk version: 1.5.3
OS: Windows 11
File format: .txt and .json tested.
Line endings: LF and CRLF tested.

App log comments:
Note that when the Enum is first loaded (12:16:53) there is no EnumDefAdded or ExternalEnumsLoaded event in the log. When the UI panel is refreshed (12:17:07) then the log shows a redundant sync because the initial import is incomplete.

[BOOT] 2025-12-20 12:16:40 App started
[BOOT] 2025-12-20 12:16:40 Version: 1.5.3-64bits (build 473703)
...
[BOOT] 2025-12-20 12:16:40 Args: soloValues=[], args=[]
...
[BOOT] 2025-12-20 12:16:40 Calling appReady...
[UPDATE] 2025-12-20 12:16:40 Looking for update
[BOOT] 2025-12-20 12:16:41 Start args: path=null levelIndex=null
[BOOT] 2025-12-20 12:16:41 Loading Home...
[GENERAL] 2025-12-20 12:16:41 Page started: page.Home()
...
[LOAD] 2025-12-20 12:16:44 Loading complete.
[GENERAL] 2025-12-20 12:16:44 Page started: page.Editor()
...
[FILE] 2025-12-20 12:16:44 Cleared all file watches
...
[USERACTION] 2025-12-20 12:16:47 Opened panel #20 ui.modal.panel.EditEnumDefs
[FILE] 2025-12-20 12:16:47 Loading HTML template editEnumDefs
[RENDER] 2025-12-20 12:16:47 Rendering world bg...
[RENDER] 2025-12-20 12:16:47 Rendering world bg...
[RENDER] 2025-12-20 12:16:49 Rendering world bg...
[IMPORT] 2025-12-20 12:16:53 Importing external enums (new file): surf_enum.json
[IMPORT] 2025-12-20 12:16:53 Sync diff result: +SurfCode
[IMPORT] 2025-12-20 12:16:53 No change in enum values data.
[IMPORT] 2025-12-20 12:16:53 Sync automatically applied.
[RENDER] 2025-12-20 12:16:59 Rendering world bg...
[RENDER] 2025-12-20 12:16:59 Rendering world bg...
[USERACTION] 2025-12-20 12:17:00 Closed panel #20 ui.modal.panel.EditEnumDefs
[USERACTION] 2025-12-20 12:17:01 Opened panel #25 ui.modal.panel.EditEnumDefs
[FILE] 2025-12-20 12:17:01 Reading HTML template editEnumDefs from cache
[RENDER] 2025-12-20 12:17:01 Rendering world bg...
[RENDER] 2025-12-20 12:17:01 Rendering world bg...
[RENDER] 2025-12-20 12:17:04 Rendering world bg...
[RENDER] 2025-12-20 12:17:04 Rendering world bg...
[RENDER] 2025-12-20 12:17:05 Rendering world bg...
[IMPORT] 2025-12-20 12:17:07 Syncing external enums: surf_enum.json
[IMPORT] 2025-12-20 12:17:07 Sync diff result: +SurfCode
[IMPORT] 2025-12-20 12:17:07 No change in enum values data.
[IMPORT] 2025-12-20 12:17:07 Sync automatically applied.
[EVENT] 2025-12-20 12:17:07 ExternalEnumsLoaded
[WARNING] 2025-12-20 12:17:07 Full level render requested
[RENDER] 2025-12-20 12:17:07 Rendering world bg...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions