Conversation
Addresses two feature requests from Eplicta.Core: 1. Mark IMemoryWithRedis and MemoryWithRedis as [Obsolete] — consumers should use IRedis or IMemory explicitly instead. 2. Add ReturnDefaultOnFirstLoad option to CacheTypeOptions that returns default(T) immediately on first cache miss, running the factory in the background. Works independently of StaleWhileRevalidate. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AppendPreviousRegistrations now skips duplicate type registrations instead of throwing. All DI service registrations use TryAdd* to prevent duplicate entries. First registration wins when the same type is registered across multiple AddCache calls. Fixes the InvalidOperationException thrown when both Platform and Quilt4Net internally call AddCache with overlapping type registrations.
MongoDB.cs was missing the RequestEvictEvent subscription that Memory, Redis, and File all have. Without it, ICacheMonitor.ClearAll() and ClearStale() never reached MongoDB-persisted items. Added IManagedCacheMonitor to the constructor and wired up the same eviction pattern used by the other persistence backends.
ConfigurationName was null by default, which caused NullReferenceException in Tharga.MongoDB's CollectionFingerprint when the cache collection was accessed. Now defaults to "Default" to match Tharga.MongoDB's Constants.DefaultConfigurationName.
Added Track<T> method to CacheMonitor that registers items in the monitoring dictionary without firing DataSetEvent. CacheBase.GetCoreAsync now calls TrackIfNeeded when a fresh item is found from persistence, making items from MongoDB/Redis/File visible in the Blazor UI immediately on first access after app restart.
Stopwatch wraps the fetch delegate in FetchQueue to measure load time. LoadDuration flows through CacheItem -> CacheMonitor -> CacheItemInfo. Blazor ListView shows a "Load Time" column. Items loaded from persistence (Track path) show null load duration. Removed TODO comment from CacheItemInfo.
MongoDB was manually mapping CacheItem fields to CacheEntity, missing LoadDuration. Redis and File serialize the full CacheItem via JSON so they already preserved it. Now MongoDB stores and restores LoadDuration, so load times survive app restarts.
Build job: restore, build, warning check (threshold 10), test with coverage, codecov, compute version, pack 5 NuGet packages. Security job: CodeQL analysis. Publish job: unified job with dynamic environment — release on master push, prerelease on PR. Pushes to NuGet and creates GitHub releases. Version scheme: 0.4.x with auto-incrementing patch from git tags.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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.
Summary
All Critical and Important backlog items resolved. New CI/CD pipeline. Major improvements to MongoDB integration and Blazor monitoring UI.
Bug fixes
AddCache()can now be called multiple times without throwing.AppendPreviousRegistrationsskips duplicates, all DI registrations useTryAdd*. First registration wins. Fixes the crash when both Platform and Quilt4Net internally callAddCache.MongoDB.csnow subscribes toRequestEvictEvent, soICacheMonitor.ClearAll()andClearStale()properly evict MongoDB-persisted items (was missing the subscription that Memory, Redis, and File all had).MongoDBCacheOptions.ConfigurationNamenow defaults to"Default"instead of null, preventingNullReferenceExceptioninCollectionFingerprintwhen no explicit config name is provided.Track<T>method toCacheMonitorthat registers persisted items in the monitoring dictionary on first access. Items from MongoDB/Redis/File now appear in the Blazor UI immediately after app restart, not only after re-fetch. Works for all persistence backends.New features
Stopwatchwraps the fetch delegate inFetchQueueto measure load time.LoadDurationflows throughCacheItem→CacheMonitor→CacheItemInfo. Blazor ListView shows a new "Load Time" column. Persisted in MongoDBCacheEntity; Redis/File get it free via JSON serialization.0.4.xwith auto-incrementing patch from git tags.IRedisorIMemoryexplicitly instead.default(T)on first cache miss instead of blocking; factory runs in the background.Documentation
Test plan