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
F3270622: D3999.id12647.diff
Sat, Nov 16, 4:37 AM
Unknown Object (File)
Wed, Nov 13, 11:31 AM
Unknown Object (File)
Tue, Nov 5, 3:36 PM
Unknown Object (File)
Tue, Nov 5, 3:36 PM
Unknown Object (File)
Tue, Nov 5, 3:36 PM
Unknown Object (File)
Tue, Nov 5, 3:35 PM
Unknown Object (File)
Tue, Nov 5, 3:32 PM
Unknown Object (File)
Sep 28 2024, 2:35 PM

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
No Lint Coverage
Unit
No Test Coverage

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.