Page MenuHomePhabricator

Implement DraftStoreOperations C++ utility
ClosedPublic

Authored by marcin on Nov 16 2022, 5:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 7:14 AM
Unknown Object (File)
Wed, Apr 3, 4:52 AM
Unknown Object (File)
Wed, Apr 3, 4:52 AM
Unknown Object (File)
Wed, Apr 3, 4:52 AM
Unknown Object (File)
Wed, Apr 3, 4:52 AM
Unknown Object (File)
Wed, Apr 3, 4:52 AM
Unknown Object (File)
Wed, Apr 3, 4:52 AM
Unknown Object (File)
Wed, Apr 3, 4:44 AM
Subscribers

Details

Summary

This differential implements DraftStoreOperations C++ utility to convert drafts related redux actions payloads to DatabaseQueryExecutor calls.

Test Plan

This differential only introduces C++ header file, so it is not possible to create test plan.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Nov 17 2022, 12:43 PM
tomek added inline comments.
native/cpp/CommonCpp/NativeModules/DraftStoreOperations.h
7 ↗(On Diff #18472)

Why do we need a virtual destructor?

native/cpp/CommonCpp/NativeModules/DraftStoreOperations.h
7 ↗(On Diff #18472)

I think we should always have a virtual destructor for anything that gets subtyped. Note that we are currently seeing compiler warnings in the native build because MessageSpec does not specify a virtual destructor

native/cpp/CommonCpp/NativeModules/DraftStoreOperations.h
7 ↗(On Diff #18472)

In CommCoreModule we will (introduced in further diffs in this stack) have function that returns object of type std::vector<std::unique_ptr<DraftStoreOperationBase>>. When it gets destroyed, destructor of each element in this vector will be called and without destructor being virtual only memory allocated for DraftStoreOperationBase would be deleted.

Note that we are currently seeing compiler warnings in the native build because MessageSpec does not specify a virtual destructor

Without any doubt it was a mistake not to introduce it. I will create Linear task to introduce virtual destructors for any C++ class in the codebase that is meant to be derived from.

Implement remove all drafts operation in C++

I will create Linear task to introduce virtual destructors for any C++ class in the codebase that is meant to be derived from.

Thank you @marcin!! Please link before landing :)

This revision was automatically updated to reflect the committed changes.