Skip to content

Handle missing signoff_id elegantly #14

Description

@powderflask

signoff_id binds a persistent DB object to a piece of code with business logic for the signoff.

If a Signoff is deleted, but there are signets in DB with its ID, that causes a crash when the registry returns None for the signoff type. The behaviour of a signet with no associated signoff is undefined, but the system should degrade predictably, not crash.

2 fixes required:

  1. Documentation: add a warning, like: deprecate signoffs, don't delete them from code base! Before deleting a signoff, update or delete all Signets from DB that store its signoff_id.

  2. Code: use Null Object pattern to return a Null signoff with very restrictive behaviours defined as a placeholder so system can continue to function despite data inconsistency.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions