Refactor SettingsBase cache lookup to use explicit LINQ filtering#1149
Merged
glennawatson merged 8 commits intoUpdateSettingsfrom Dec 4, 2025
Merged
Refactor SettingsBase cache lookup to use explicit LINQ filtering#1149glennawatson merged 8 commits intoUpdateSettingsfrom
glennawatson merged 8 commits intoUpdateSettingsfrom
Conversation
2 tasks
Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com>
Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com>
Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com>
Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com>
Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com>
Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add response to feedback on SettingsBase refactor
Refactor SettingsBase cache lookup to use explicit LINQ filtering
Dec 4, 2025
glennawatson
approved these changes
Dec 4, 2025
ChrisPulman
added a commit
that referenced
this pull request
Dec 5, 2025
* Refactor SettingsBase to use primary constructor and improve cache selection Refactored SettingsBase to use a C# primary constructor and updated the logic for selecting the appropriate IBlobCache. The new logic prioritizes explicitly created caches, falls back to CacheDatabase caches, and finally creates an in-memory cache if a serializer is available. Improved error handling and exception messages for missing caches. * Update CI workflow to run PRs on main branch The CI workflow now runs on pull requests targeting the main branch. Added global environment variable for productNamespacePrefix and set build configuration to Release. * Update src/Akavache.Settings/SettingsBase.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/ci-build.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add test coverage for SettingsBase cache fallback logic (#1148) * Initial plan * Add test coverage for SettingsBase fallback logic - Tests verify fallback to CacheDatabase.UserAccount when no explicit cache configured - Tests verify settings persistence across instances - Tests demonstrate the fallback priority logic - Some edge case tests remain challenging due to static state interference Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Complete fallback test coverage with passing tests - All new tests pass successfully - All existing tests continue to pass (18 total) - Tests validate CacheDatabase fallback when no explicit cache configured - Tests validate settings persistence across multiple instances - Removed flaky tests that had static state interference issues Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> Co-authored-by: Chris Pulman <chris.pulman@yahoo.com> * Refactor SettingsBase cache lookup to use explicit LINQ filtering (#1149) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> Co-authored-by: Chris Pulman <chris.pulman@yahoo.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> Co-authored-by: Glenn <5834289+glennawatson@users.noreply.github.com>
|
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. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Addresses feedback on #1147 to replace implicit filtering within a foreach loop with explicit LINQ filtering.
Changes
if (kvp.Value != null)check inside loop to explicit.FirstOrDefault(kvp => kvp.Value != null)predicatefirstPair.Keyinstead offirstPair.Valueto distinguish actual dictionary entries from defaultKeyValuePairstructBefore/After
The fallback chain to
CacheDatabasecaches remains unchanged when no cache is found inAkavacheBuilder.BlobCaches.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.