Remove dangling CurrentTransaction properties that always return null#60
Merged
mrdevrobot merged 2 commits intomainfrom Apr 14, 2026
Merged
Conversation
…nd DocumentDbContext Agent-Logs-Url: https://github.com/EntglDb/BLite/sessions/1ccc90b6-c35c-46eb-a95b-3749d4bb4032 Co-authored-by: mrdevrobot <12503462+mrdevrobot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CurrentTransaction returning null in v4.3
Remove dangling Apr 14, 2026
CurrentTransaction properties that always return null
mrdevrobot
approved these changes
Apr 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the now-dead CurrentTransaction API surface from BLiteEngine/DocumentDbContext and from IDocumentDbContext, after the caller-owned transaction refactor made those properties permanently null.
Changes:
- Remove
ITransaction? CurrentTransaction { get; }fromIDocumentDbContext. - Remove the
=> nullstubCurrentTransactionimplementations fromBLiteEngineandDocumentDbContext. - Remove stale tests asserting
BLiteEngine.CurrentTransactionisnull, and update the 4.3 “what’s new” interface snippet accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/BLite.Tests/BLiteEngineAdditionalTests.cs | Deletes stale tests that asserted engine-level CurrentTransaction was null. |
| src/BLite.Core/IDocumentDbContext.cs | Removes CurrentTransaction from the public interface contract. |
| src/BLite.Core/DocumentDbContext.cs | Removes CurrentTransaction stub property returning null. |
| src/BLite.Core/BLiteEngine.cs | Removes CurrentTransaction stub property returning null. |
| WHATS_NEW_4.3.md | Updates the documented IDocumentDbContext snippet to no longer include CurrentTransaction. |
Comments suppressed due to low confidence (1)
tests/BLite.Tests/BLiteEngineAdditionalTests.cs:231
- This test is named as if it covers the synchronous BeginTransaction(), but it actually calls BeginTransactionAsync(). Either update the test to call BeginTransaction() or rename it so it matches what is being exercised; otherwise it can mask regressions in the sync API.
public async Task BeginTransaction_ReturnsActiveTransaction()
{
var txn = await _engine.BeginTransactionAsync();
Assert.NotNull(txn);
Assert.Equal(TransactionState.Active, txn.State);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
343
to
347
| ### DbContext Transaction API | ||
|
|
||
| ```csharp | ||
| public interface IDocumentDbContext | ||
| { |
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.
After the caller-owned transaction refactoring in
f42b3e6,BLiteEngine.CurrentTransactionandDocumentDbContext.CurrentTransactionbecame dead code hardwired tonull, silently breaking any code that read the property after callingBeginTransaction().Changes
IDocumentDbContext— removesITransaction? CurrentTransaction { get; }from the interface contractBLiteEngine/DocumentDbContext— removes the=> nullstub implementationsBLiteEngineAdditionalTests— removes three tests that asserted the property wasnull(now stale)WHATS_NEW_4.3.md— dropsCurrentTransactionfrom the documented interface snippetBLiteSession.CurrentTransactionis unchanged — it tracks a real per-session transaction and remains valid.Migration
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
av-build-tel-api-v1.avaloniaui.net/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll 20' --output-dircredential.username(dns block)If you need me to access, download, or install something from one of these locations, you can either: