Repository navigation
Match GitHub and GitLab descriptions with line breaks after a sync - #52
Merged
Merged
Conversation
GitLab returns a project description entered in its web form with CRLF line endings. The Sync page passes the remote description to the save request through an HTML data attribute, and the browser's HTML parser reads CRLF (and a lone CR) there as LF, so sim saves LF. The next sync compared GitLab's CRLF with the saved LF and listed the software for update again, however often the update was applied. Read GitHub and GitLab descriptions with LF line endings, as the browser would, so the saved description matches and the Sync page's description comparison agrees. Fixes #31 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slominskir
approved these changes
Nov 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #31
Cause
GitLab returns a project description entered in its web form with CRLF line endings. The Sync page writes the remote description into the row's
data-descriptionattribute, andsync.jsposts that attribute's value when you click Update or Add. The browser's HTML parser reads CRLF (and a lone CR) in the page as LF, so sim saves the description with LF. The next sync compares GitLab's CRLF with the saved LF, so the software is listed for update again however often you apply it.Change
SyncServicenow reads GitHub and GitLab descriptions with LF line endings (normalizeLineEndings), the same text the browser would send. The saved description then matches inSoftware.syncEquals, and the Sync page's description comparison agrees too. The other repositories (CSUE, Certified) take descriptions from jsoup'stext(), which already joins lines with spaces, and LLAPP has no descriptions.Descriptions you've already synced need no upgrade: they were saved with LF, so they match on the next sync. You can put back the multi-line GitLab descriptions removed as the issue's workaround.
No deployment steps, schema change or settings.
Checks
accgroup currently have multi-line descriptions (the issue's workaround removed them), so I couldn't sample one there.a\r\nb\rcas"a\nb\nc".SyncServiceParseTest.multiLineDescriptionMatchesWhatSimSavedparses a GitLab project whose description has CRLF, CR and LF line endings and diffs it against the software as sim saved it (LF). It fails without the fix (the parsed description keeps its CRs) and passes with it../gradlew build(Spotless, PMD, SpotBugs, unit tests): passes../gradlew integrationTestagainst this branch's rebuilt app: 51 tests, all pass. The Sync pages call GitHub, GitLab and JLab's internal pages, which have no stand-in, so no integration test can cover this change.Decisions
would keep GitLab's CRLF through the browser, but descriptions edited in the software dialog are saved with LF (a textarea's value always has LF), so sim would hold a mix of the two. Normalizing when reading the remote description keeps everything sim saves with LF and also fixes the Sync page's own description comparison.source::ailabel, and creating one changes the repository's settings, so I left it to you.Prepared-by: Anthropic Claude Code:claude-opus-5-5
🤖 Generated with Claude Code