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

Log HTTP 409 error responses with breadcrumbs #613

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Conversation

samholmes
Copy link
Contributor

@samholmes samholmes commented Aug 30, 2024

The breadcrumbs were left in places leading up to /v2/login/create and
/v2/login/keys endpoints to the login server.

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

src/core/account/account-init.ts Show resolved Hide resolved
@@ -37,6 +37,9 @@ async function createChildLogin(
login: LoginTree,
appId: string
): Promise<LoginTree> {
// For crash errors:
ai.props.log.breadcrumb('createChildLogin', {})
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this to ensureAccountExists as part of the logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There already is a log to ensureAccountExists. But it doesn't necessarily catch whether createChildLogin was invoked.

src/core/account/account-api.ts Outdated Show resolved Hide resolved
src/core/login/edge.ts Outdated Show resolved Hide resolved
src/core/login/edge.ts Outdated Show resolved Hide resolved
Comment on lines +67 to +68
// For crash errors:
ai.props.log.breadcrumb('makeKeysKit', {})
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems redundant with all the other logging, but I guess we could keep it to have a trace like:

  • createCurrencyWallet
  • makeKeysKit (no kidding?)
  • crash: Login API conflict error

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'm erring on the side of redundancy since this could be a race-condition issue somewhere, so having more information even if it's obvious could reveal to us the race condition.

The breadcrumbs were left in places leading up to `/v2/login/create` and
`/v2/login/keys` endpoints to the login server.
@samholmes samholmes enabled auto-merge September 2, 2024 22:23
@samholmes samholmes merged commit 63020c3 into master Sep 2, 2024
2 checks passed
@samholmes samholmes deleted the sam/409-formula branch September 2, 2024 22:30
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.

2 participants