v1::write_concern (CXX-3237, CXX-3238) #1504
Open
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.
Resolves CXX-3237 and CXX-3238 for the
v1::write_concerncomponent.The
test/private/write_concern.cpptest component is removed: it was only asserting that specific mongoc functions were being invoked by specific mongocxx functions. This behavior is broken by the v1 API + v_noabi refactor, which now uses the*_int64variants ofmongoc_write_concern_set_wtimeout()accessors and avoids callingmongoc_write_concern_set_wmajority()in favor of*_set_w() + *_set_wtimeout()individually. For backward compatibility,.to_document()avoids appending the "wtimeout" field as a$numberLongunless it is strictly necessary, otherwisewc.timeout(0).to_document().view() == scoped_bson{R"({"wtimeout": 0})"}.view()evaluates to false (int32 vs. int64).