Skip to content

Fix silent data loss when record identifier is missing in XmlMergeService#380

Merged
imnasnainaec merged 3 commits into
masterfrom
fix/xml-merge-null-check
Jul 2, 2026
Merged

Fix silent data loss when record identifier is missing in XmlMergeService#380
imnasnainaec merged 3 commits into
masterfrom
fix/xml-merge-null-check

Conversation

@imnasnainaec

@imnasnainaec imnasnainaec commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

In `XmlMergeService.MakeRecordDictionary`, the null-guard tested `identifierAttribute` (the parameter, always validated non-empty) instead of `identifier` (the value read from XML). Records whose identifier attribute was absent in the XML were silently added to the dictionary under a `null` key instead of triggering a warning and being skipped.

Change `identifierAttribute` to `identifier` in the `string.IsNullOrEmpty` call.

Fixes #373

Devin review: https://app.devin.ai/review/sillsdev/chorus/pull/380


This change is Reviewable

…ictionary

The IsNullOrEmpty check used 'identifierAttribute' (the parameter name, always
non-empty) instead of 'identifier' (the value read from XML). Records with a
missing identifier attribute were silently added under a null key rather than
triggering a warning and being skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imnasnainaec imnasnainaec self-assigned this Jun 22, 2026
@imnasnainaec imnasnainaec marked this pull request as ready for review June 22, 2026 18:59
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

Test Results

       8 files  ±0     333 suites  ±0   2h 23m 43s ⏱️ -54s
   992 tests ±0     936 ✔️ ±0    56 💤 ±0  0 ±0 
3 157 runs  ±0  3 034 ✔️ ±0  123 💤 ±0  0 ±0 

Results for commit fa39ece. ± Comparison against base commit 3571e47.

♻️ This comment has been updated with latest results.

@rmunn rmunn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good catch; the logic was indeed supposed to flag records that don't have the attribute, which is what the bugfix will do now.

@imnasnainaec imnasnainaec merged commit cdbc34c into master Jul 2, 2026
7 checks passed
@imnasnainaec imnasnainaec deleted the fix/xml-merge-null-check branch July 2, 2026 11:58
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.

Wrong variable in null check in XmlMergeService.MakeRecordDictionary causes silent data loss

2 participants