Skip to content

fix: only one incoming value added when exchanging an empty repeatable field - #450

Merged
psmagin merged 1 commit into
masterfrom
MODDICORE-516
Oct 2, 2026
Merged

psmagin merged 1 commit into
masterfrom
MODDICORE-516

Conversation

@psmagin

@psmagin psmagin commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Fix only one incoming value added when exchanging an empty repeatable field

Approach

With the "Delete all existing and add these" action (EXCHANGE_EXISTING) and an
initially empty array, alreadyRemovedForExchange was never set on the first
iteration, so the second incoming value deleted the first one. Set the flag on
the first iteration regardless of whether anything was removed.

Update the test that asserted the old behavior and add a regression test.

Changes Checklist

  • Logging: Confirm that logging is appropriately handled.
  • Unit Testing: Confirm that changed classes were covered by unit tests.
  • NEWS: Confirm that the NEWS file is updated with relevant information about the changes made in this pull request.

Related Issues

https://folio-org.atlassian.net/browse/MODDICORE-516

… field

With the "Delete all existing and add these" action (EXCHANGE_EXISTING) and an
initially empty array, alreadyRemovedForExchange was never set on the first
iteration, so the second incoming value deleted the first one. Set the flag on
the first iteration regardless of whether anything was removed.

Update the test that asserted the old behavior and add a regression test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@psmagin
psmagin requested a review from a team as a code owner October 2, 2026 09:17
@psmagin psmagin changed the title Fix only one incoming value added when exchanging an empty repeatable field fix: only one incoming value added when exchanging an empty repeatable field Oct 2, 2026
@psmagin psmagin self-assigned this Oct 2, 2026
@psmagin psmagin added the ai label Oct 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

@psmagin
psmagin merged commit 22dc650 into master Oct 2, 2026
20 of 21 checks passed
@psmagin
psmagin deleted the MODDICORE-516 branch October 2, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants