Skip to content

Keep a deleted-company force delete when a contact is updated - #2982

Open
mmeest wants to merge 1 commit into
masterfrom
fix/keep-invalid-company-force-delete-on-contact-update
Open

mmeest wants to merge 1 commit into
masterfrom
fix/keep-invalid-company-force-delete-on-contact-update

Conversation

@mmeest

@mmeest mmeest commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Summary

A domain that was already under force delete because its registrant company had been deleted came back to status ok when a contact was updated. The update did not replace the domain contacts and did not change the contact name, phone, or email. On zuxu.ee this was an EPP contact:update of the existing technical contact. The company-register job later put the restrictions back, because the company was still deleted, which produced the repeating morning ok and evening force-delete history.

Fast-track force delete for invalid_company stores serverForceDelete, serverRenewProhibited, and serverTransferProhibited, plus a status note such as Company no: 12018413 + Contact has status deleted + Kustutamiskanne. It does not set template_name to invalid_company. That template name is what already stops the soft path from being lifted.

Saving the contact runs email validation and then remove_force_delete_for_valid_contact. A contact with no failed email checks counts as valid, including one whose email did not change. The remaining guard was supposed to keep the restriction when the force-delete note contains Company no: and the registrant registry code. status_notes is a hash, and the check walked each entry as a key/value pair and looked for that text inside the pair. The note never matched, so the guard did not apply. Canceling force delete removed the three restriction statuses, and the empty status list was saved as ok.

The check now reads the serverForceDelete note and compares it with the registrant registry code, which is the text written when the force delete is scheduled. A contact update keeps those statuses while that note is present. Force delete scheduled for an invalid email is still lifted when the related contacts validate.

Test plan

  • rails test test/models/contact/email_verification_force_delete_test.rb (6 runs, 0 failures)
  • Local fast-track invalid_company domain stays restricted after the same technical contact is updated with unchanged name, phone, and email
  • Soft invalid_company force delete still stays in place
  • Invalid-email force delete is still lifted when the contacts are valid

Made with Cursor

Fast-track invalid company stores the reason only in the status note, and that note was read as a hash entry, so a contact update cleared the force-delete statuses.

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant