Context
Currently, the internal session implementation is located in /x/mongo/driver/session, which is technically accessible to users despite being experimental. According to the MongoDB Driver Sessions Specification, ServerSession (our session.Client) is explicitly described as "an implementation detail and does not need to be public."
The public mongo.Session type correctly implements the spec-required ClientSession interface, but the underlying implementation should be moved to an internal package to prevent accidental user dependencies on internal session state (e.g. HELP-58664).
Definition of done
See here for deprecation examples: https://docs.google.com/document/d/1rtqAVdI6Xf3rJnLj82YD2ZRBFshlTh1E6n-nv7k0wVo/edit?tab=t.0
MoveĀ /x/mongo/driver/session/ to /internal/session/
Pitfalls
- Users who import go.mongodb.org/mongo-driver/v2/x/mongo/driver/session will get compile errors
- Advanced users creating driver.Operation{Client: *session.Client} manually will lose access to session.Client
- Large refactor touching many files increases merge conflict risk
- clones
-
GODRIVER-3736 Move session implementation to internal package
-
- Needs Triage
-
- is depended on by
-
GODRIVER-3736 Move session implementation to internal package
-
- Needs Triage
-
- related to
-
GODRIVER-3663 Expose atClusterTime parameter in snapshot sessions
-
- Closed
-
-
GODRIVER-3734 Move transaction status methods to public Session
-
- Closed
-