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

22784_fix_401_response_on_nr_approvals #1547

Merged

Conversation

EPortman
Copy link
Collaborator

@EPortman EPortman commented Nov 7, 2024

Issue #: https://app.zenhub.com/workspaces/names-team-board-new-655554cbddd49510027dad2e/issues/gh/bcgov/entity/22784

Description of changes:
Problem: When a Name Request (NR) is approved, an unnecessary second patch request is sent, leading to a 401 error. This happens because the currentNameChoice is incorrectly set to undefined during the approval process.

Solution: Removed the code that sets the currentNameChoice to undefined from the parseNr method in the Examine Store.

Detailed Explanation

  • Upon NR approval via makeDecision(APPROVED), the pushDecision(APPROVED) and subsequently updateNRState(APPROVED) are triggered. Code Reference
  • This sequence leads to fetchAndLoadNr(nrNum) and then to parseNr(), where currentNameChoice was being set to undefined. Code Reference
  • With currentNameChoice undefined, the system incorrectly attempts to process a Next Name Choice, resulting in an unauthorized patch request. Code Reference
  • There seems to be no reason why the currentNameChoice gets set to undefined in parseNr. The application still has full functionality without that code.

Update E2E Tests for the fixed functionality.

  • Instead of waiting for the approval request to finish, the tests for approvals now ensure the response has a status code of 200.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namex license (Apache 2.0).

@EPortman
Copy link
Collaborator Author

EPortman commented Nov 7, 2024

/gcbrun

@bcregistry-sre
Copy link
Collaborator

Temporary Url for review: https://namex-dev--pr-1547-6jpp1w9a.web.app

@EPortman EPortman marked this pull request as draft November 8, 2024 18:53
@EPortman EPortman force-pushed the 22784_fix_401_response_on_nr_approvals branch from 257766b to fab1d06 Compare November 8, 2024 23:36
@EPortman EPortman marked this pull request as ready for review November 8, 2024 23:58
@EPortman EPortman merged commit 72d1ac4 into bcgov:main Nov 12, 2024
4 of 5 checks passed
@EPortman EPortman deleted the 22784_fix_401_response_on_nr_approvals branch November 12, 2024 22:26
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