Page MenuHomePhabricator

[identity] make sure otk exists when we delete it
ClosedPublic

Authored by varun on Wed, Apr 17, 11:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 8:03 PM
Unknown Object (File)
Sat, Apr 27, 7:27 PM
Unknown Object (File)
Sat, Apr 27, 1:09 AM
Unknown Object (File)
Wed, Apr 24, 7:59 AM
Unknown Object (File)
Mon, Apr 22, 1:07 PM
Unknown Object (File)
Mon, Apr 22, 10:37 AM
Unknown Object (File)
Sat, Apr 20, 4:15 PM
Unknown Object (File)
Wed, Apr 17, 7:45 PM
Subscribers

Details

Summary

since DeleteItem is idempotent, we need to check that the key actually exists when we try deleting it, otherwise we'll be decrementing the otk count but not actually removing any otks

Test Plan

confirmed that if the key doesn't exist, the transaction fails

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Theoretically, we should check if partition and sort key exist (because the otk attribute is present for all rows) but technically, this way also works - the "otk" attribute won't exist for non-existing row (implies non-existing primary key)

This revision is now accepted and ready to land.Thu, Apr 18, 12:15 AM