Merge pull request #5919 from jsangmeister/fix-action-interface2

Fix action interface2
This commit is contained in:
Finn Stutzenstein 2021-03-01 07:22:49 +01:00 committed by GitHub
commit d293832199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -3,11 +3,12 @@
/** /**
* Executes multiple actions in the context of the user given by the user_id. * Executes multiple actions in the context of the user given by the user_id.
* There are two modes of execution: * There are two modes of execution:
* atomic=false (default): * atomic=true (default):
* All actions are validated in common, so if one action or one payload of * All actions are validated in common, so if one action or one payload of
* one action fails, the request is aborted with an ActionException indicating * one action fails, the request is aborted with an ActionException indicating
* the problematic action with both indices. * the problematic action with both indices.
* atomic=true: * => The whole request is handled atomically.
* atomic=false:
* Each action is validated by it's own. If there is an error, the error must * Each action is validated by it's own. If there is an error, the error must
* be reported via an ActionError in the ActionsResponse. The actions result * be reported via an ActionError in the ActionsResponse. The actions result
* is not written into the Datastore. It might raise an ActionException if the * is not written into the Datastore. It might raise an ActionException if the
@ -53,7 +54,7 @@ interace ActionsResponse {
* respective action data. If not, the error is of general fashion and/or not directly * respective action data. If not, the error is of general fashion and/or not directly
* associated with a single action data. * associated with a single action data.
* *
* Note: ActionError can only be used if atomic=true. * Note: ActionError can only be used if atomic=false.
*/ */
interface ActionError { interface ActionError {
success: false; success: false;
@ -67,7 +68,7 @@ interface ActionError {
* action and data, respectively. If there were general errors, both indices must be * action and data, respectively. If there were general errors, both indices must be
* omitted or null. * omitted or null.
* *
* If the atomic flag was true in the request, it is not allowed to send * If the atomic flag was false in the request, it is not allowed to send
* action-specific errors with this exception. It must be responded with an * action-specific errors with this exception. It must be responded with an
* ActionError through ActionsResponse (resulting in a status code of 200). * ActionError through ActionsResponse (resulting in a status code of 200).
*/ */