Skip to content

Sanitize user-visible employee sync failures - #23

Draft
dvir001 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-scanning-alert-13
Draft

Sanitize user-visible employee sync failures#23
dvir001 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-scanning-alert-13

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Alert #13 flagged that raw exception text from employee sync failures could be persisted in sync status and surfaced through the settings API/UI. This change limits externally visible failure details to safe messages while preserving server-side diagnostics.

  • What changed

    • Replaced persisted str(exc) values in employee sync failure handling with a fixed generic message for unexpected errors.
    • Kept logging unchanged so full exception details remain available in server logs.
  • Behavioral adjustment

    • Preserved the explicit "No employees returned from Graph API." status as a safe, intentional user-facing failure case instead of routing it through generic exception handling.
  • Tests

    • Updated focused sync-status coverage to assert the sanitized error message for unexpected failures.
except Exception as exc:
    logger.exception("Employee data sync failed (source=%s): %s", source, exc)
    mark_data_update_finished(
        success=False,
        error="Employee sync failed due to an internal error.",
        source=source,
    )

Co-authored-by: dvir001 <39403717+dvir001@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code scanning alert #13 Sanitize user-visible employee sync failures Aug 17, 2026
Copilot AI requested a review from dvir001 August 17, 2026 10:31
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