Skip to content

feat: allow replacing a registered link resolver - #117

Open
ehennestad wants to merge 1 commit into
promote-extension-interfacesfrom
add-resolver-reregistration
Open

feat: allow replacing a registered link resolver#117
ehennestad wants to merge 1 commit into
promote-extension-interfacesfrom
add-resolver-reregistration

Conversation

@ehennestad

@ehennestad ehennestad commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

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 KGResolver in openminds-kg-sync keeps its state in a persistent variable instead of on the instance: the instance it registered could never be replaced.

openminds.registerLinkResolver(resolver, Replace=true)

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 Replace the first registration wins; with it the new resolver takes over the prefix without adding a duplicate.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Test Results (R2022a)

762 tests  +1   761 ✅ +1   2m 13s ⏱️ -25s
 20 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit bbf211b. ± Comparison against base commit ed9b383.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Test Results (R2026a)

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit bbf211b.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.00%. Comparing base (6402b97) to head (09631fb).

Files with missing lines Patch % Lines
...enminds/+internal/+resolver/LinkResolverRegistry.m 87.50% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ehennestad
ehennestad force-pushed the add-resolver-reregistration branch from e772e1c to 09631fb Compare September 1, 2026 14:31
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
ehennestad force-pushed the add-resolver-reregistration branch from 09631fb to bbf211b Compare September 1, 2026 20: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.

1 participant