Skip to content

Magic IndexedDB v2.0.3 - .NET 10, Engine Hardening, and Cross-Browser Reliability - #128

Merged
magiccodingman merged 14 commits into
releasefrom
master
Aug 21, 2026
Merged

Magic IndexedDB v2.0.3 - .NET 10, Engine Hardening, and Cross-Browser Reliability#128
magiccodingman merged 14 commits into
releasefrom
master

Conversation

@magiccodingman

Copy link
Copy Markdown
Owner

Magic IndexedDB 2.0.3 is a substantial reliability and maintainability release. It upgrades the project to .NET 10, strengthens serialization and streaming, fixes several query and browser-specific bugs, expands enum and dictionary support, modernizes the documentation, and introduces required cross-browser validation for future changes.

Highlights

  • Upgraded the complete project to .NET 10.
  • Improved serialization, streaming, and interop resource management.
  • Added deterministic constructor selection with [MagicConstructor].
  • Added enum query support, including named enums using System.Text.Json.
  • Fixed nested dictionary deserialization.
  • Fixed ordering, pagination, and TakeLast query behavior.
  • Added required Chromium, Firefox, Linux WebKit, and macOS WebKit validation.
  • Expanded automated coverage to 46 contract/unit tests and 113 browser scenarios.
  • Added trusted NuGet publishing from the protected release branch.
  • Rebuilt and expanded the project documentation.

.NET 10 upgrade

Magic IndexedDB now targets net10.0 across the library, tests, examples, and supporting projects.

The upgrade also includes:

  • Updated ASP.NET Core, Blazor, Playwright, MSTest, and related dependencies.
  • Support for C# 14 expression-tree shapes used by array Contains queries.
  • Updated examples that previously relied on removed or legacy APIs.
  • More deterministic browser-test execution and database cleanup.

Existing applications must target a framework capable of referencing the .NET 10 package.

Constructor materialization

A new optional [MagicConstructor] attribute provides explicit control over which constructor Magic IndexedDB uses when materializing records.

Constructor selection is now deterministic:

  1. A single [MagicConstructor]
  2. A single [JsonConstructor]
  3. A public parameterless constructor
  4. The only public constructor
  5. The legacy most-parameters convention with deterministic tie-breaking

Additional improvements include:

  • Case-insensitive constructor parameter matching.
  • Support for optional parameter defaults.
  • Support for immutable and read-only constructor-bound properties.
  • Population of remaining writable properties after construction.
  • Clear errors when constructor annotations are ambiguous.
  • Continued support for [JsonConstructor].

Normal repository registration, querying, and database operation syntax remains unchanged.

Serialization and memory improvements

Serialization and JavaScript interop have been hardened throughout the engine:

  • Correctly preserve escaped strings, backslashes, newlines, tabs, control characters, and Unicode.
  • Preserve nested collections, arrays, sets, dictionaries, and nested complex objects.
  • Preserve Magic property names inside nested structures.
  • Honor configured System.Text.Json converters.
  • Preserve JavaScript results such as 0, false, empty strings, and null.
  • Propagate JavaScript errors with useful context.
  • Stop swallowing property conversion failures.
  • Replace JSON-inside-JSON parameter encoding with a versioned internal wire envelope containing real JSON values.
  • Serialize the internal envelope directly to streams.
  • Remove forced garbage collection and finalizer pauses.
  • Dispose JavaScript references, streams, response objects, and cancellation resources correctly.

These changes address the previously reported memory spikes while also improving correctness and diagnostics.

Progressive streaming

AsAsyncEnumerable() now processes streamed data progressively instead of waiting for the complete result to be buffered.

Streaming improvements include:

  • Registering chunk consumers before JavaScript production begins.
  • Draining chunks concurrently with

@magiccodingman
magiccodingman merged commit 58c99df into release Aug 21, 2026
10 checks passed
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