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

APS-1815: Throw if page already visited #2297

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

froddd
Copy link
Contributor

@froddd froddd commented Jan 16, 2025

When building the main task list or fetching statuses for building un-submitted application summaries, some answer combinations may unintentionally produce an infinite loop due to how the next page to check is determined.

To prevent this, a simple trail of pages that have already been visited is built whenever such a loop is running. If a page has already been visited, an error is now thrown: this prevents the current process running indefinitely, and will alert us of the trail of pages that caused the infinite loop, so the issue can be remedied.

In addition, when no data has been saved against a given page, the loop attempts to check the next page as defined in the Task. Due to certain logic combinations, this page may already have been checked, which may also produce an infinite loop (or, thanks to the fix above, an error!). To prevent this, pages are removed from the pool as they are checked.

Context

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

@froddd froddd changed the title Throw if page already visited BUGFIX/APS-1815: Throw if page already visited Jan 16, 2025
@froddd froddd force-pushed the bugfix/APS-1815-prevent-task-list-infinite-loop branch from 854f090 to 8234977 Compare January 16, 2025 15:42
@froddd froddd changed the title BUGFIX/APS-1815: Throw if page already visited APS-1815: Throw if page already visited Jan 16, 2025
When building the main task list or fetching statuses for building
un-submitted application summaries, some answer combinations may
unintentionally produce an infinite loop due to how the next page to
check is determined.

To prevent this, a simple trail of pages that have already been visited
is built whenever such a loop is running. If a page has already been
visited, an error is now thrown: this prevents the current process
running infinitely, and will alert us of the trail of pages that caused
the infinite loop, so the issue can be remedied.
If a page has no data, the next page defined in the task is selected to
continue building the task list. This removes pages from the list of
pages to check as the task list is being built, to ensure pages are not
checked twice through this.
@froddd froddd force-pushed the bugfix/APS-1815-prevent-task-list-infinite-loop branch from 8234977 to e05d04e Compare January 16, 2025 16:56
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.

1 participant