Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guardian should respond with a simple 'Bubble has been terminated' message if the bubble is terminated and has already been deleted #17

Open
dnpotter opened this issue Jun 11, 2024 · 0 comments

Comments

@dnpotter
Copy link
Contributor

Minor error message issue.

When a request to access a bubble fails because the bubble has been terminated, the Guardian instructs the data server to delete the bubble. If the bubble is already deleted the Guardian responds to the client with the message "bubble has been terminated - send a 'terminate' request to delete the bubble data". Instead it should simply respond with "bubble has been terminated".

    if (file.permissions.bubbleTerminated()) {
      const terminateOptions = (method === 'terminate') ? params.options : undefined;
      return this.dataServer.terminate(params.contract, terminateOptions)
        .then(() => {
          if (method === 'terminate') return;
          else throw new BubbleError(ErrorCodes.BUBBLE_ERROR_BUBBLE_TERMINATED, 'bubble has been terminated');
        })
        .catch((err) => {
          if (method === 'terminate') return _validateDataServerError(err);
          else throw new BubbleError(ErrorCodes.BUBBLE_ERROR_BUBBLE_TERMINATED, "bubble has been terminated - send a 'terminate' request to delete the bubble data");
        })
    }

The Guardian should pass the {silent: true} option to the data server if the method is not 'terminate'. This will ensure the data server does not reject if the bubble is already deleted, and will restrict the longer error message to only when the bubble exists and the data server failed to delete it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant