Skip to content

Conversation

@fredzqm
Copy link
Contributor

@fredzqm fredzqm commented Sep 27, 2024

Tested here. Having the error message makes it so much easy to tell what happened.

We can polish up additional error handling later.

To prod:
Screenshot 2024-09-27 at 11 19 18 AM

To emulator:
Screenshot 2024-09-27 at 11 23 33 AM

@fredzqm fredzqm requested a review from hlshen September 27, 2024 18:20
const cause = await this.decodeResponse(response);

throw new DataConnectError(
`Request failed with status ${response.status}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It swallowed the error message here.

clientResponse as ClientResponse<ExecuteGraphqlResponseError>;
response as ClientResponse<ExecuteGraphqlResponseError>;
throw new DataConnectError(
`Request failed with status ${clientResponse.status}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It swallowed the error message here.

const client = new Client({
urlPrefix: endpoint,
apiVersion: "v1beta",
auth: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this to use "x-mantle-admin": "all" instead. auth: true may send production auth tokens to the emulator and may run into issues when developing offline.

If the Client API doesn't do what we want, then using fetch is also okay for now. We can always clean code up later but let's not mess with the behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about remove auth: true here?

x-mantle-admin doesn't matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested executing against emulator. Everything works fine, both error and success.

Copy link
Contributor Author

@fredzqm fredzqm Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some emulator logs: https://paste.googleplex.com/6332029630414848

Good catch on not sending auth token.
Emulator has V(3) debug logs for the auth token, won't log by default even if someone sends a real token to it.

@fredzqm fredzqm enabled auto-merge (squash) September 27, 2024 18:35
@fredzqm fredzqm merged commit f464017 into master Sep 27, 2024
@fredzqm fredzqm deleted the fz/exec-panel branch September 27, 2024 18:51
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

Successfully merging this pull request may close these issues.

3 participants