[SERVER-77056] Assert the validity of the SerializationContext object on the expression context for DocumentSourceCollStats::createFromBson Created: 11/May/23  Updated: 09/Dec/23  Resolved: 08/Dec/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Hugh Tong (Inactive) Assignee: Backlog - Service Architecture
Resolution: Won't Fix Votes: 0
Labels: ntdi_must_have
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-84042 Complete TODO listed in SERVER-77056 Open
Assigned Teams:
Service Arch
Sprint: Service Arch Prioritized List, Server Serverless 2023-08-21
Participants:
Story Points: 2

 Description   

`DocumentSourceCollStats::createFromBson()` passes a `SerializationContext` object pulled from the expression context into the `IDLParserContext` object used by `DocumentSourceCollStatsSpec::parse()`, but the expression context may or may not contain a valid `SerializationContext` object.  An invalid `SerializationContext` object can be default constructed on construction of an `ExpressionContext` object as `ExpressionContext` objects are used in several different ways.  When an `ExpressionContext` object is constructed via an `AggregateCommandRequest`, it should always contain a valid `SerializationContext` object, so we should assert this when `DocumentSourceCollStatsSpec::parse()` is called in order to avoid serializing a collStats reply incorrectly yet failing silently.



 Comments   
Comment by Didier Nadeau [ 08/Dec/23 ]

Closing as we're deprecating the SerializationContext in favor of the VTS.

Generated at Thu Feb 08 06:34:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.