DEV Community

Noah Taro
Noah Taro

Posted on

Use Four Result States for Safer Publishing Workflows

A boolean success flag is not expressive enough for real publishing automation. A submission can be confirmed, explicitly rejected, blocked before submission, or submitted without enough evidence to determine the final result.

Those cases should map to four states:

  • confirmed success,
  • confirmed failure,
  • blocked before side effect,
  • pending confirmation.

The last state is especially important. Automatically republishing an unresolved submission can create duplicates. Instead, the verifier should visit the account page, look for a recent item with the expected author and content, and only then decide whether a retry is safe.

This state model makes records more accurate and makes recovery behavior much easier to reason about.

Top comments (0)