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

Prevent infinite loop for ineligible application #2276

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

froddd
Copy link
Contributor

@froddd froddd commented Jan 7, 2025

This prevents an infinite loop when building the task list generating the task statuses for a task list for an application that has the ESAP AP type selected but no agreement with CHPP. The loop was the result of the ineligibility page returning the user to the AP type selection page on submission. This works if the user then saves a different AP type straight away; however, should the user then exit the application, any further attempt to load the application would result in the loop.

To prevent this, the ESAP ineligibility page no longer posts, but simply offers a link to the AP Type selection.

In addition, to ensure the AP Type task is shown as 'In progress' in the above scenario, the ESAP ineligibility page always returns an error. This error is never shown, but prevents the loop from continuing with processing any further task when building the task list for the draft application.

Context

https://dsdmoj.atlassian.net/browse/APS-1778

Changes in this PR

The page that offers to continue with a Standard AP (or to choose another type of AP altogether) now uses a button as link to take the user to the AP type page. The 'Back to dashboard' link next to this button is also now fixed, as it was showing as undefined (and with a broken URL) due to an incorrect path.

Screenshots of UI changes

Before

(Broken URL shown below)

Screenshot 2025-01-07 at 18 26 47

After

Screenshot 2025-01-07 at 18 25 53

This prevents an infinite loop when building the task list for an
application that has the ESAP AP type selected but no agreement with
CHPP. The loop was the result of the ineligibility page returning the user
to the AP type selection page on submission. This works if the user then saves a
different AP type straight away; however, should the user then exit the
application, any further attempt to load the application would result in
the loop.

To prevent this, the ESAP ineligibility page no longer posts, but simply
offers a link to the AP Type selection.

In addition, to ensure the AP Type task is shown as 'In progress' in the
above scenario, the ESAP ineligibility page always returns an error.
This error is never shown, but prevents the loop from continuing with
processing any further task.
@froddd froddd force-pushed the bugfix/APS-1778-esap-infinite-loop branch from 8c0b27c to b46148d Compare January 8, 2025 07:12
Copy link
Contributor

@bobmeredith bobmeredith left a comment

Choose a reason for hiding this comment

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

I reproduced the issue locally and the fix worked fine.
Code LGTM.
Nice one!

@froddd froddd merged commit a709cf2 into main Jan 8, 2025
7 checks passed
@froddd froddd deleted the bugfix/APS-1778-esap-infinite-loop branch January 8, 2025 09:34
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