Skip to content

Comments

fix: normalize newlines in variable comparison for resource sync#1172

Open
litlmike wants to merge 1 commit intomoghtech:mainfrom
litlmike:fix-issue-627
Open

fix: normalize newlines in variable comparison for resource sync#1172
litlmike wants to merge 1 commit intomoghtech:mainfrom
litlmike:fix-issue-627

Conversation

@litlmike
Copy link

@litlmike litlmike commented Feb 8, 2026

Problem

When a TOML variable contains newlines (multi-line literal string like """..."""), the resource sync status checker shows a perpetual "pending update" state. The diff comparison shows identical content on both sides with no change markers.

This happens because the TOML parser normalizes line endings to \n, but values stored in the database (e.g. via the web UI) may contain \r\n. The direct string equality check sees them as different even though the content is semantically identical.

Fix

Normalize \r\n to \n before comparing variable values and descriptions in both get_updates_for_view and get_updates_for_execution.

Fixes #627

When a TOML variable contains newlines (multi-line literal strings),
the TOML parser normalizes line endings to \n, but values stored in
the database may contain \r\n. This mismatch causes the resource sync
status checker to perpetually show a pending update state, even though
the diff shows identical content on both sides.

Fix by normalizing \r\n to \n before comparing variable values and
descriptions.

Fixes moghtech#627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newline characters in a variable causes perpetual ResourceSyncPendingUpdate state

1 participant