feat: allow replacing a registered link resolver - #117
Open
ehennestad wants to merge 1 commit into
Open
Conversation
ehennestad
force-pushed
the
add-resolver-reregistration
branch
from
August 31, 2026 10:39
e812691 to
e772e1c
Compare
Contributor
Contributor
Test Results (R2026a)0 tests 0 ✅ 0s ⏱️ Results for commit bbf211b. ♻️ This comment has been updated with latest results. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## promote-extension-interfaces #117 +/- ##
=============================================================
Coverage 80.00% 80.00%
=============================================================
Files 422 422
Lines 4061 4066 +5
=============================================================
+ Hits 3249 3253 +4
- Misses 812 813 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ehennestad
force-pushed
the
add-resolver-reregistration
branch
from
September 1, 2026 14:31
e772e1c to
09631fb
Compare
Registering a resolver whose IRI prefix was already registered was silently ignored, with no way to swap the registered resolver out. A library that reconfigures, for example connecting to a different server or with new credentials, could not make its new resolver take effect short of resetting the whole registry through an internal class. This is why the KG resolver kept its state in a persistent variable rather than on the instance. openminds.registerLinkResolver(resolver, Replace=true) now replaces the resolver registered for that prefix, keeping its position in the registry. The default remains idempotent registration, so startup code that registers unconditionally is unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ehennestad
force-pushed
the
add-resolver-reregistration
branch
from
September 1, 2026 20:58
09631fb to
bbf211b
Compare
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.
Registering a resolver whose IRI prefix was already registered was silently ignored, and there was no way to swap the registered resolver out short of resetting the whole registry through an internal class. A library that reconfigures — connecting to a different server, or with new credentials — could not make its new resolver take effect. This is why
KGResolverin openminds-kg-sync keeps its state in apersistentvariable instead of on the instance: the instance it registered could never be replaced.replaces the resolver registered for that prefix, keeping its position in the registry. The default stays as it was — idempotent registration — so startup code that registers unconditionally is unaffected.
Test covers both behaviours: without
Replacethe first registration wins; with it the new resolver takes over the prefix without adding a duplicate.🤖 Generated with Claude Code