Skip to content

Eng 2502 add ignore errors path to async polling#7401

Open
Vagoasdf wants to merge 12 commits intomainfrom
ENG-2502-add-ignore-errors-path-to-async-polling
Open

Eng 2502 add ignore errors path to async polling#7401
Vagoasdf wants to merge 12 commits intomainfrom
ENG-2502-add-ignore-errors-path-to-async-polling

Conversation

@Vagoasdf
Copy link
Contributor

@Vagoasdf Vagoasdf commented Feb 17, 2026

Ticket ENG 2502

Description Of Changes

Extended the ignore errors config key handle to properly work on the async polling lifecycle

Code Changes

polling_request_handler.py

  • Added _should_ignore_error(status_code, ignore_errors) static method that mirrors AuthenticatedClient._should_ignore_error (True = all, list = specific codes, False = none).
  • Added _send_and_handle_errors static method that sends, checks ignore, and raises -- reused by both get_status_response and get_result_response.
  • Both get_status_response and get_result_response now pass ignore_errors to client.send and use the shared error handling.

async_dsr_strategy_polling.py

  • _handle_polling_initial_request: on ignored error, logs and continues (skips sub-request creation) using status-code-aware check.. same change for the erasure path.
  • _initial_request_access: now only raises AwaitingAsyncProcessing when sub-requests were created. Returns [] when all were ignored (matching the existing erasure path behavior).

Steps to Confirm

  1. Set up Bazaarvoice, a integration we know has a ingore errors configured
  2. Run an normal access request with any identity
  3. Run an additional access request with the same identity. Bazaarvoice will raise an 409 error due to the request being duplicated. The error should be ignored

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link
Contributor

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Feb 18, 2026 5:16pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Feb 18, 2026 5:16pm

Request Review

@Vagoasdf Vagoasdf marked this pull request as ready for review February 18, 2026 17:12
@Vagoasdf Vagoasdf requested a review from a team as a code owner February 18, 2026 17:12
@Vagoasdf Vagoasdf requested review from johnewart and removed request for a team February 18, 2026 17:12
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 18, 2026

Greptile Summary

This PR fixes the async polling lifecycle to properly respect the ignore_errors configuration that was already supported in the synchronous request path. Previously, when client.send() returned a non-ok response (even for ignored status codes), the polling code would immediately raise an exception, effectively ignoring the ignore_errors setting.

  • polling_request_handler.py: Adds _should_ignore_error and _send_and_handle_errors static methods to centralize error handling for status/result polling requests. Both get_status_response and get_result_response now delegate to _send_and_handle_errors.
  • async_dsr_strategy_polling.py: Adds ignore-error guards in both _handle_polling_initial_request (access) and _handle_polling_initial_erasure_request (erasure) paths. When all initial requests return ignored errors, _initial_request_access returns [] instead of raising AwaitingAsyncProcessing, preventing infinite re-entry into the initial phase.
  • Tests: Updates the existing "failure in ignore list" test to verify the new skip behavior (no exception, no sub-requests created). Adds comprehensive tests for all-ignored access, mixed ignored/success, and all-ignored erasure scenarios.
  • The _should_ignore_error logic is duplicated from AuthenticatedClient._should_ignore_error — consider extracting to a shared utility to avoid drift.

Confidence Score: 4/5

  • This PR is safe to merge — it fixes a real bug where ignore_errors was not respected in the async polling lifecycle, with good test coverage.
  • The logic changes are correct and well-tested. The _should_ignore_error duplication is a minor maintainability concern but not a functional risk. The ignore-error check pattern is repeated in three places in the strategy file, which could be consolidated, but all three are correct. Test coverage is thorough with positive and negative cases.
  • src/fides/api/service/async_dsr/strategies/async_dsr_strategy_polling.py has the most behavioral changes and duplicated ignore-error patterns worth reviewing carefully.

Important Files Changed

Filename Overview
changelog/7401-add-ignore-errors-path-to-async-polling.yaml Standard changelog entry for the fix. No issues.
src/fides/api/service/async_dsr/handlers/polling_request_handler.py Adds _should_ignore_error (duplicated from AuthenticatedClient) and _send_and_handle_errors to centralize error handling for status/result requests. Refactors get_status_response/get_result_response to use the shared helper. Logic is correct.
src/fides/api/service/async_dsr/strategies/async_dsr_strategy_polling.py Adds ignore-error guards to both access and erasure initial request paths. Changes _initial_request_access to return [] instead of raising AwaitingAsyncProcessing when all requests were ignored. Contains duplicated ignore-error checking pattern that could reuse _send_and_handle_errors.
tests/ops/service/async_dsr/polling/handlers/test_polling_request_handler.py Adds four well-structured tests for the new ignore_errors behavior in the handler: returns response for ignored codes, still raises for unlisted codes. Good coverage for both status and result request paths.
tests/ops/service/async_dsr/polling/test_async_polling_strategy.py Updates existing test to match new behavior (skip instead of raise) and adds three new integration-style tests for all-ignored access, mixed ignored/success access, and all-ignored erasure scenarios. Thorough test coverage of the new behavior.

Last reviewed commit: 5df181e

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +38 to +55
@staticmethod
def _should_ignore_error(
status_code: int,
ignore_errors: Optional[Union[bool, List[int]]],
) -> bool:
"""
Determine if an error response should be ignored based on the ignore_errors config.

Mirrors AuthenticatedClient._should_ignore_error:
- False: do not ignore any errors
- True: ignore all errors
- List[int]: ignore only if status_code is in the list
"""
if ignore_errors is True:
return True
if isinstance(ignore_errors, list):
return status_code in ignore_errors
return False
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicated _should_ignore_error logic

This static method duplicates the logic from AuthenticatedClient._should_ignore_error (line 175 in authenticated_client.py). While the duplication is acknowledged in the docstring, having two copies of this branching logic creates a maintenance risk — if the original is updated (e.g., to support new ignore patterns), this copy could drift silently.

Consider extracting this into a shared utility function that both AuthenticatedClient and PollingRequestHandler can import, to keep the logic in one place.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +319 to +326
if not response.ok and PollingRequestHandler._should_ignore_error(
response.status_code, read_request.ignore_errors
):
logger.info(
"Ignoring errored response with status code {} for initial async polling request as configured.",
response.status_code,
)
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant _should_ignore_error check after client.send

client.send(next_request, read_request.ignore_errors) (line 317) already uses ignore_errors internally — when the status code matches, AuthenticatedClient.send returns the response without raising RequestFailureResponseException. The _should_ignore_error check on line 319 then re-evaluates the same condition.

While this double-check is functionally safe (and necessary given that send returns the non-ok response instead of filtering it out), it would be clearer to extract this into a shared helper like _send_and_handle_errors in PollingRequestHandler — which you've already built. Consider reusing PollingRequestHandler._send_and_handle_errors here as well to keep the error handling pattern consistent and avoid repeating the ignore + raise logic in three separate places (here, the erasure path at line 381, and _send_and_handle_errors).

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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

Comments