Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for DryIoc - Change Append to Replace for keyed (contract) registrations #753

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

ChrisPulman
Copy link
Member

@ChrisPulman ChrisPulman commented Aug 18, 2021

fix for #752 Keyed instances can only have a single instance so keep latest

What kind of change does this PR introduce?

DryIoc only allows single registrations for keyed (Contract) registrations

What is the current behaviour?

DryIoc currently crashes when a duplicate registration is made with contract

What is the new behaviour?

DryIoc now replaces the registration with the new instance

What might this PR break?

none expected as would previously throw an exception in this instance

Please check if the PR fulfils these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

This issue stemmed from Akavache due to a double call to Registrations Akavache.Core.Registrations which registers a default InMemory Cache and Akavache.Sqlite3.Registrations with a db Cache, both are called with the same registration details.

fix for #752 Keyed instances can only have a single instance so keep latest
@codecov
Copy link

codecov bot commented Aug 18, 2021

Codecov Report

Merging #753 (7341d69) into main (932d901) will increase coverage by 0.27%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #753      +/-   ##
==========================================
+ Coverage   74.43%   74.70%   +0.27%     
==========================================
  Files          99       99              
  Lines        4968     4970       +2     
==========================================
+ Hits         3698     3713      +15     
+ Misses       1270     1257      -13     
Impacted Files Coverage Δ
src/Splat.DryIoc/DryIocDependencyResolver.cs 84.54% <100.00%> (+12.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 932d901...7341d69. Read the comment docs.

@ChrisPulman ChrisPulman merged commit 1ae8a34 into main Aug 18, 2021
@ChrisPulman ChrisPulman deleted the fix_752_DryIocDuplicateKey branch August 18, 2021 21:28
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] UseDryIocDependencyResolver() throws container exception with Akavache
2 participants