Skip to content

Fix/annexes link to not provided documents - #652

Merged
tsubik merged 3 commits into
developfrom
fix/annexes-not-provided-documents
Sep 28, 2026
Merged

tsubik merged 3 commits into
developfrom
fix/annexes-not-provided-documents

Conversation

@tsubik

@tsubik tsubik commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes annexes still being copied into the doc_not_provided history entry when a document is deleted, or expires from not required, and goes back to not provided.

  • OperatorDocument#destroy disconnects annexes before update!, so create_history no longer copies them; both run in one transaction
  • disconnect_annexes also resets the cached operator_document_annexes, so a list loaded earlier can't be copied into history
  • Destroy spec reloads the document first; the stale cached association was hiding the bug
  • New fix:annexes_not_provided_history rake task removes annex links from doc_not_provided history entries. Annexes carried over to later versions before the disconnect release (2026-01-09) are left as they are

Deploy notes

  • Deploy first, then run bin/rails fix:annexes_not_provided_history (dry run), review the output and rerun with FOR_REAL=true.

JIRA: https://gfw.atlassian.net/browse/OPEN-418

🤖 Generated with Claude Code

@tsubik
tsubik requested a review from santostiago September 15, 2026 12:31
@tsubik
tsubik force-pushed the fix/annexes-not-provided-documents branch from 714598d to 7be21fe Compare September 15, 2026 12:36
@tsubik
tsubik force-pushed the fix/annexes-not-provided-documents branch from 7be21fe to 3d8a778 Compare September 28, 2026 14:07
@tsubik
tsubik merged commit 250c9e7 into develop Sep 28, 2026
4 checks passed
@tsubik
tsubik deleted the fix/annexes-not-provided-documents branch September 28, 2026 14:28
@tsubik tsubik mentioned this pull request Sep 30, 2026
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.

2 participants