Skip to content

Add sync resilience edge-case tests (empty tracker response, per-item parse failure) #91

Description

@Zlyzart

Summary

The synchronization logic in crates/core/src/sync.rs needs to be hardened against common API inconsistencies encountered when pulling issue data from external trackers. Currently, while the core divergence rule is well-tested for successful syncs, the handling of empty response sets or mixed batches containing malformed records is brittle and could lead to runtime panics or silent failures in production. This update will implement full resilience checks, ensuring that a zero-result page or a partially bad payload causes graceful logging and continuation without disrupting the board synchronization process.

Acceptance criteria

  • The sync logic must successfully reconcile an empty result set (e.g., API returns {"issues": []}). No divergence events should be logged, and no errors/panics should occur.
  • If a bulk response contains a mix of valid issues and invalid ones (malformed fields), the sync process must log the specific error for each bad item but continue processing all successfully parsed records in the same batch.
  • Any attempt to read optional fields missing from an issue record must gracefully default to a safe, known state without panicking or causing a panic/crash.

Out of scope

This refinement does not change how data is retrieved (i.e., it relies on jsonpath.rs for path resolution); it only changes how the already-parsed list of records is consumed and reconciled within sync.rs. It also explicitly excludes implementing schema validation beyond what is covered by the existing type checks.

Files in scope

  • crates/core/src/sync.rs (Primary implementation location)
  • crates/core/tests/e2e.rs (New test fixtures required to validate mixed-content and empty cases)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:engineRust core/CLI: crates/core, crates/cli.area:testsUnit, integration, and e2e test suites.complexity:sonnetMedium scope; may span multiple files or require iteration.priority:lowNice to have; backlog.priority:mediumMeaningful improvement; normal queue.status:refinedAgent-refined (acceptance criteria + proposed complexity); awaiting a human's go.type:tech-debtKnown shortcut to repay; reduces future friction.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions