Repository navigation
FIX: Register created converters and targets only after the response is built - #2964
Merged
varunj-msft merged 1 commit intoOct 6, 2026
Conversation
…is built The backend registered a new converter or target before mapping it to the API response, so a mapping failure left the object registered and, for converters, left its uploaded files behind. Create now constructs the object, builds the response, and registers it last. Any failure removes the request's uploads and leaves nothing registered.
This was referenced Oct 2, 2026
hannahwestra25
approved these changes
Oct 6, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 6, 2026
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.
Description
Split out of #2959.
ConverterService.create_converter_asyncandTargetService.create_target_asyncregistered the new object first and mapped it to the API response afterwards. If mapping failed (identifier generation, capabilities, nested targets, DTO validation), the request failed but the object stayed registered, and the converter's uploaded files were left behind. For example,TextTargetwithcustom_configuration={}returned 500 and stayed registered, so retrying with the same name failed with "already exists".Create is now atomic:
create_instance), build the response, and register it last. The mappers read only the object and class metadata, never the instance registry.await), so a request that lost the name to a concurrent create never runs its constructor. Nothing between that check andregisterawaits.Coordination:
Registry.create_instance_from_external_input, which REST creation must use, and changes these same create calls. Whichever merges second keeps this PR's construct → map → register order and builds withcreate_instance_from_external_input. Git merges this PR'screate_instance(...)line into the converter service outside the conflict markers, so check that line; FIX: Accept only supported external inputs when building components #2959's service tests fail if the external check is lost.create_target_asyncdocstring intarget_service.py; whichever merges second keeps both descriptions.Tests and Documentation
tests/unit/backend/test_converter_service.py):tests/unit/backend/test_target_service.py): a mapping failure leaves nothing registered.python -m pytest tests/unit/backend -n 4— 1713 passed, 4 skipped.ruff format/ruff check— passed;ty check pyrit/— no new diagnostics; pre-commit hooks pass.build_and_testworkflow run on the fork at c298f5c: pre-commit on ubuntu/windows/macOS andmake unit-test-juniton ubuntu/windows/macOS x Python 3.11-3.14 x dev/dev_all — all 35 jobs passed.TextTargetwithcustom_configuration={}still returns 500 on this branch (FIX: Accept only supported external inputs when building components #2959 makes it a 400), but the target is not registered and the same name can be created right after.