Skip to content

Conversation

@mfaferek93
Copy link
Collaborator

@mfaferek93 mfaferek93 commented Jan 26, 2026

Pull Request

Summary

allow CLEARED faults to be reactivated by FAILED events

Previously, report_fault_event() had an early return that silently
ignored all events for CLEARED faults. This caused faults to remain
CLEARED forever even when the underlying issue recurred.

Changes:

  • FAILED events now reactivate CLEARED faults with debounce counter
    reset to -1 (fresh start)
  • PASSED events for CLEARED faults are still ignored (expected)
  • occurrence_count increments on reactivation
  • Return true to trigger EVENT_CONFIRMED and snapshot capture

Updated tests to reflect new behavior and added integration test.


Issue

Link the related issue (required):


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

How was this tested / how should reviewers verify it?


Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

@mfaferek93 mfaferek93 marked this pull request as ready for review January 26, 2026 18:57
Copilot AI review requested due to automatic review settings January 26, 2026 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes fault reactivation behavior so that faults in CLEARED state can transition back to an active state when new FAILED events arrive (closing #144).

Changes:

  • Allow CLEARED → (PREFAILED/CONFIRMED) transitions on new FAILED events (both in-memory and SQLite storage).
  • Reset debounce counter on reactivation and increment occurrence_count, updating sources/description as appropriate.
  • Update/extend unit + integration tests to cover cleared-fault reactivation behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/ros2_medkit_fault_manager/src/fault_storage.cpp Enables reactivation of CLEARED faults in in-memory storage by handling FAILED events specially.
src/ros2_medkit_fault_manager/src/sqlite_fault_storage.cpp Enables reactivation of CLEARED faults in SQLite storage by updating status/counters/sources on FAILED events.
src/ros2_medkit_fault_manager/test/test_fault_manager.cpp Updates unit tests for in-memory storage to validate reactivation, PASSED-ignore behavior, and debounce restart.
src/ros2_medkit_fault_manager/test/test_sqlite_storage.cpp Updates unit tests for SQLite storage to validate reactivation, PASSED-ignore behavior, and debounce restart.
src/ros2_medkit_fault_manager/test/test_integration.test.py Adds an integration test ensuring a CLEARED fault becomes active again after a new FAILED report.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

@mfaferek93 mfaferek93 self-assigned this Jan 26, 2026
@mfaferek93 mfaferek93 added the bug Something isn't working label Jan 26, 2026
…events

  Previously, report_fault_event() had an early return that silently
  ignored all events for CLEARED faults. This caused faults to remain
  CLEARED forever even when the underlying issue recurred.

  Changes:
  - FAILED events now reactivate CLEARED faults with debounce counter
    reset to -1 (fresh start)
  - PASSED events for CLEARED faults are still ignored (expected)
  - occurrence_count increments on reactivation
  - Return true to trigger EVENT_CONFIRMED and snapshot capture

  Updated tests to reflect new behavior and added integration test.
@mfaferek93 mfaferek93 force-pushed the fix/144/FaultMangerClearedIssue branch from d2013b8 to 1843cee Compare January 26, 2026 19:26
@mfaferek93 mfaferek93 requested a review from bburda January 26, 2026 19:26
@mfaferek93 mfaferek93 merged commit 8fcb10b into main Jan 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] FaultManager ignores new FAILED reports after a fault was CLEARED

3 participants