Clear a resolved result-lookup error when a terminal review result reconciles

Open Beginner friendly
#1,239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
postgresql, rust

Research direction

Start in crates/registry-breg/src/review_store.rs at reconcile_result, then compare the sibling cancellation and claim paths that clear last_error_code. Add the requested Postgres regression test for a failed poll followed by a successful result, and verify the projection reports recovery.state: none for the terminal review.

Written by the indexing model from the issue text.

Description

An automated review of #1189 flagged a stale error code on reconciled reviews. A failed result lookup in crates/registry-breg/src/review_store.rs records last_error_code='result-lookup-uncertain' on the submission, but reconcile_result commits the terminal result without clearing it: the sibling cancellation and claim paths do clear the column, that one does not. The projection then maps any non-null last_error_code to recovery: {state: operatorAttention, code}.

Failure scenario: one result poll fails and a later poll returns the available result. The review completes correctly, yet the projection reports operatorAttention next to its valid terminal result indefinitely for a manual review, and until some other application error overwrites the code for an automatic one. Operators are told to act on a review that is already settled.

Suggested fix:

  • Clear last_error_code in the same transaction that reconciles a terminal result.
  • Add a Postgres test that fails one poll, succeeds on the next, and asserts the projection reports recovery.state: none.

Filed from the review of #1189; not merge-blocking.

Dominant language
Rust
Stars
2
Forks
0
Avg merge
3h 45m
Merged PRs (30d)
134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from registrystack/registry-stack

All issues in registrystack/registry-stack

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.