RDBC-1021/1024/1025 Fix no-tracking includes guard, session refresh in-place, and lazy load None#271
Open
redknightlois wants to merge 3 commits intoravendb:v7.2from
Open
RDBC-1021/1024/1025 Fix no-tracking includes guard, session refresh in-place, and lazy load None#271redknightlois wants to merge 3 commits intoravendb:v7.2from
redknightlois wants to merge 3 commits intoravendb:v7.2from
Conversation
ce7a76a to
2660ad4
Compare
…a no_tracking session session.load(..., includes=...) and query._include() silently discarded includes when no_tracking=True, giving callers a false sense of correctness. C# raises InvalidOperationException with "Cannot register includes when NoTracking is enabled." Added the same guard to both the load() path and the query _include() method, using the full C# exception message. Regression test: test_no_tracking_includes_guard.py verifies that include calls raise InvalidOperationException on no-tracking sessions for load, query, and document_query paths.
…-place _refresh_internal() was converting a fresh entity and deep-copying it, leaving the caller's original reference stale. Fix: update entity.__dict__ from the freshly converted object so the caller sees the new server state without needing to use the return value. Regression test: test_session_refresh.py verifies that the original entity reference reflects the updated server state after refresh() is called, that the return value is tracked, and that the change vector is updated.
`if not ids: return None` returned the bare None value for a None id, so lazy.value raised AttributeError. Now returns Lazy(lambda: None), so lazy.value is None as C# specifies. Regression test: test_lazy_load_null.py verifies that lazily.load(None) resolves to None without raising AttributeError.
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.
Issue link
https://issues.hibernatingrhinos.com/issue/RDBC-1021
https://issues.hibernatingrhinos.com/issue/RDBC-1024
https://issues.hibernatingrhinos.com/issue/RDBC-1025
Additional description
RDBC-1021 –
session.query(...).include(...)andsession.advanced.document_query(...).include(...)now raiseValueErrorimmediately whensession.no_trackingisTrue, matching C# behaviour. Previously the call succeeded silently and the included documents were never cached.RDBC-1024 –
session.advanced.refresh(entity)was creating a new object and replacing theDocumentInfoentry, leaving the caller's original reference stale. Fixed by updatingentity.__dict__in-place so the caller's reference immediately reflects the refreshed server state.RDBC-1025 –
session.advanced.lazily.load(None)returnedNoneinstead ofLazy(None). Fixed by returningLazy(lambda: None)for aNoneid, consistent with how the C# client handles it.Type of change
How risky is the change?
Backward compatibility
Is it platform specific issue?
Documentation update
Documentation Requiredtag.Testing by Contributor
private)Testing by RavenDB QA team
QA Requiredtag.Is there any existing behavior change of other features due to this change?
UI work
Studio Requiredtag.