Skip to content

[Bug]: reversing multiple follow-up block actions can fail #16204

@eviljeff

Description

@eviljeff

Follow-up from #16119

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

https://mozilla.sentry.io/issues/7448848020/?query=is%3Aunresolved&referrer=issue-stream

(1452, 'Cannot add or update a child row: a foreign key constraint fails (`addons_allizom_org`.`log_activity_block`, CONSTRAINT `log_activity_block_block_id_6f5144af_fk_blocklist_block_id` FOREIGN KEY (`block_id`) REFERENCES `blocklist_block` (`id`) ON DELETE RESTRI)')

My theory is the using in get_blocks_from_guids means if we attempt to unblock twice in the same transaction, then we'll be trying to delete a block that was already deleted. Which seems to be handed in the actual deletion code, but the logging function fails because the activity log is trying to fk to an already deleted block record.

What did you expect to happen?

We don't attempt to delete a block that is already deleted - or at least fail quietly.

┆Issue is synchronized with this Jira Task

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions