Skip to content

Sandbox: Improved Global Error Handler, Duplicate Handling, Enrollment Concurrency Improvement#328

Merged
CritiqalPete merged 10 commits intosandboxfrom
fix/global-error-handler
Mar 24, 2025
Merged

Sandbox: Improved Global Error Handler, Duplicate Handling, Enrollment Concurrency Improvement#328
CritiqalPete merged 10 commits intosandboxfrom
fix/global-error-handler

Conversation

@a-v25
Copy link
Copy Markdown
Contributor

@a-v25 a-v25 commented Mar 24, 2025

Description

This PR updates the global error handler mainly to address the issues with CREATECONTACT:CONFLICT errors over the past few weeks. In addition, I addressed the issue mentioned in #284, but we might need to change the message delivered to the user (coach).

All changes

  1. attributes field is saved into vars.originalAttributes and used while sending error notifications through Slack. This prevents Endpoint: N/A N/A messages.
  2. Slack error messages include the same message as what the client receives.
  3. "Message" is added to the Slack message to indicate message field received by the client.
  4. Implemented correct handling of the contact creation errors.
  5. Implemented correct handling of the search errors.
  6. Implemented correct handling of the waiver creation errors.
  7. Implemented correct handling of the enrollment creation errors.
  8. Added "Until Successful" block to enrollment creation with 10 retries and 2.5 seconds wait time.

Examples

Create Duplicate Error

image image

Mailformed ID

image image

Search with 1 character

image image

UNABLE_TO_LOCK_ROW error when creating Enrollments

image

a-v25 added 10 commits March 23, 2025 21:55
1) `attributes` are saved into `vars.originalAttributes` and used while sending error notifications through Slack
2) Slack error messages include the same message as what the client receives
3) Added "Message to user" to the Slack message to indicate `message` field received by the client
4) Implemented Correct Handling of the Duplicate Errors
1. Remove the part that manually queries the database to find duplicates – This logic should come from Salesforce.
2. Remove the “missing fields” custom error – This should be handled by APIKIT.
Copy link
Copy Markdown
Member

@CritiqalPete CritiqalPete left a comment

Choose a reason for hiding this comment

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

key stability improvements thanks

@CritiqalPete CritiqalPete merged commit 46b3ef3 into sandbox Mar 24, 2025
3 checks passed
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