Page MenuHomePhabricator

[services] consistently return when trying to remove non-existent item
ClosedPublic

Authored by karol on May 11 2022, 2:19 AM.
Tags
None
Referenced Files
F2829556: D3999.diff
Fri, Sep 27, 4:53 PM
Unknown Object (File)
Sun, Sep 15, 9:42 AM
Unknown Object (File)
Sun, Sep 15, 9:42 AM
Unknown Object (File)
Tue, Sep 3, 5:46 AM
Unknown Object (File)
Tue, Sep 3, 5:46 AM
Unknown Object (File)
Tue, Sep 3, 5:46 AM
Unknown Object (File)
Tue, Sep 3, 5:46 AM
Unknown Object (File)
Tue, Sep 3, 5:45 AM

Details

Summary

Depends on D3990

Raised in https://phabricator.ashoat.com/D3990#112037

We should be consistent and throw if someone tries to remove an item that does not exist. That clearly means the logic's invalid.

Test Plan
cd services
yarn run-tunnelbroker-service
yarn test-blob-service-dev-mode
yarn test-backup-service-dev-mode

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I think ideally the changes in services/tunnelbroker/src/Database/DatabaseManager.cpp would've been applied in D3990. See feedback here

tomek requested changes to this revision.May 12 2022, 2:42 AM

That clearly means the logic's invalid.

No. It might also mean that we tried to delete the same item twice, which is fine. Take a C++ map as an example: when we erase an item twice, it doesn't throw an error.

We can consider returning some info about the presence of an item, but I still wouldn't call this an error.

This revision now requires changes to proceed.May 12 2022, 2:42 AM

Hmm, maybe you're right. I'm going to wait until we have terms in D3990. Then we can either land or abandon this one.

karol retitled this revision from [services] Throw when trying to remove non-existent item to [services] consistently return when trying to remove non-existent item.May 13 2022, 2:24 AM

I'm not a big fan of silently returning if expected items do not exist but accepting this as we agreed before in D3990.

This revision is now accepted and ready to land.May 13 2022, 4:26 AM
This revision was landed with ongoing or failed builds.May 13 2022, 4:30 AM
This revision was automatically updated to reflect the committed changes.