[Sever v3] Split CertificateBasedActionIdempotentOutcome into specific outcomes #7279
Labels
A-Server
Area: Server application
I-Postgresql
Impact: Postgresql issue
refactor
Improve code, don't change behavior
Milestone
At the moment, the
CertificateBasedActionIdempotentOutcome
internal outcome is used as placeholder for different outcomes containing a timestamp and leading to a reply of the formRep*Already*
:parsec-cloud/server/parsec/components/realm.py
Lines 38 to 40 in 182422d
In paticular, it's used for the following replies:
authenticated_cmds.latest.realm_create.RepRealmAlreadyExists
authenticated_cmds.latest.realm_share.RepRoleAlreadyGranted
authenticated_cmds.latest.realm_unshare.RepRecipientAlreadyUnshared
authenticated_cmds.latest.realm_rename.RepInitialNameAlreadyExists
authenticated_cmds.latest.user_revoke.RepUserAlreadyRevoked
This is confusing, especially since the reply itself is properly specialized. Instead, we should use 5 properly named outcome for those 5 replies.
Note that other outcomes with a timestamp exists, such as:
BadKeyIndex
(which should be renamedBadKeyIndexOutcome
for consistency)RepSequesterInconsistency
(which should be renamedRepSequesterInconsistencyOutcome
for consistency)1Also note that some other replies including the name
Already
do not provide a timestamp, for instance:OrganizationBootstrapStoreBadOutcome.ORGANIZATION_ALREADY_BOOTSTRAPPED
OrganizationCreateBadOutcome.ORGANIZATION_ALREADY_EXISTS
BlockCreateBadOutcome.BLOCK_ALREADY_EXISTS
InviteNewForUserBadOutcome.CLAIMER_EMAIL_ALREADY_ENROLLED
InviteCancelBadOutcome.INVITATION_ALREADY_DELETED
UserCreateUserStoreBadOutcome.USER_ALREADY_EXISTS
UserCreateDeviceStoreBadOutcome.DEVICE_ALREADY_EXISTS
VlobCreateBadOutcome.VLOB_ALREADY_EXISTS
This raises the question of why some replies/outcome include a timestamp and some don't. This choice seems to depend on certain clients use cases, which indicates a strong coupling between the client and the server. Instead, my opinion is that all errors based on existing information should include the timestamp of when that information became valid in the system. Note that some errors do not depend on a specific existing information, such as all the
X_NOT_FOUND
errors.Footnotes
Sidenote:
SequesterInconsistency
,SequesterServiceNotAvailable
andRejectedBySequesterService
do not inherit fromBadOutcome
, which should be fixed when sequester gets properly implemented. ↩The text was updated successfully, but these errors were encountered: