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

fix: handle unexpected state when a record is viewed before registration confirmation #8299

Merged
merged 6 commits into from
Jan 9, 2025

Conversation

rikukissa
Copy link
Member

Root cause:

  1. User registers a record and it is sent to country config for validation
  2. Before it is confirmed, some user views the record causing its task history to change
  3. Record gets confirmed by CC, but now the "previous task" is the view task and not the awaiting validation task

… set to awaiting validation and country config confirming the record
@rikukissa rikukissa requested review from euanmillar and Nil20 January 8, 2025 03:09

This comment has been minimized.

Copy link
Collaborator

@euanmillar euanmillar left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@makelicious makelicious left a comment

Choose a reason for hiding this comment

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

Looks good. I checked other uses of createNewTaskResource and unless there are more non-null assertions way up in the chain, we should be good.

If we feel extra paranoid, we could clean up the incoming extensions in createNewTaskResource. However, it does not address any specific issue but rather vaguely just "deals with it", even if it should not happen anymore.

packages/workflow/src/records/fhir.test.ts Outdated Show resolved Hide resolved
packages/workflow/src/records/fhir.ts Show resolved Hide resolved
@rikukissa
Copy link
Member Author

Thanks for the review! Yea, I tend to err on the side of not dong anything "just in case" so the code always represents the real known cases. I clarified the tests and addressed other feedback

@rikukissa rikukissa added this to the v1.6.2 milestone Jan 9, 2025
@rikukissa rikukissa enabled auto-merge (squash) January 9, 2025 03:30
@rikukissa rikukissa disabled auto-merge January 9, 2025 03:30
@rikukissa rikukissa removed the request for review from Nil20 January 9, 2025 03:31
@rikukissa rikukissa merged commit d82f526 into develop Jan 9, 2025
37 of 39 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 9, 2025
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