Skip to content

Delete blockers indicating blocking resources without linking to them #4592

Description

@melton-jason

Describe the bug
A clear and concise description of what the bug is.

Screen.Recording.2024-02-27.at.11.07.25.PM.mov

To Reproduce

  1. Go to https://fitznhmaoct2023-edge.test.specifysystems.org/specify/view/agent/2215/
  2. Log into the NHMA Fresh water Collection (as petrifiedroadkill)
  3. Wait for delete blockers to be fetched
  4. Observe behavior
  • OS: macOs Sonoma 14.3
  • Browser: Chrome
  • Specify 7 Version: edge
  • Database Name: Fitz_NHMA_Oct_2023
  • Collection name: NHMA Fresh water

Developer Context
As indicated/implied in the video, this is a frontend issue: the backend endpoint to fetch delete blockers is properly returning the correct results.
More specifically, the Delete blocker query constructing by the frontend after fetching the delete blockers from the backend is returning an empty array when run (i..e, the rows variable in the Promise is an empty array in this case)

? createQuery(
'Delete blockers',
directRelationship.table
).set('fields', [
QueryFieldSpec.fromPath(directRelationship.table.name, [
directRelationship.table.idField.name,
])
.toSpQueryField()
.set('isDisplay', false)
.set('operStart', queryFieldFilters.in.id)
.set('startValue', ids.join(',')),
/*
* TODO: ParentRelationship.model.name should always be directRelationship.model.name.
* Check if that can never be the case
*/
QueryFieldSpec.fromPath(
parentRelationship.relatedTable.name,
[
parentRelationship.name,
parentRelationship.relatedTable.idField.name,
]
).toSpQueryField(),
])
: resolveParentViaOtherside(
parentRelationship,
directRelationship,
resource.id
)
),
{
limit: 0,
}
).then((rows) =>
rows.map(([direct, parent]) => ({
direct,
parent,
}))
),

It was mentioned by @realVinayak that the problem is most likely related to the scoping of the CollectingEvent/CollectionObject records which are the parents of the Collector records.
The Delete blocker query likely scopes results to the currently logged in collection and thus would return no results if the records exist in a different scope then the currently logged in collection.
This can be partially confirmed by creating and running a query in the NHMA Fresh water collection on CollectionObject and filtering on CollectingEvent -> Collector -> ID, using one of the Collector IDs returned from the delete blocker endpoint

Activity

  1. added
    1 - BugIncorrect behavior of the product
    2 - FormsIssues that are related to the form system
    on Feb 28, 2024
  2. lexiclevenger commented on Apr 23, 2024

    @lexiclevenger

    I'm also running into this on KUPaleoBot_8_31_2023 with a delete blocker for a collection object associated with a loan:

    Screenshot 2024-04-23 at 3 32 46 PM
  3. melton-jason commented on Jul 2, 2024

    @melton-jason
    ContributorAuthor

    Describe the bug The deletion blocker dialog for a collection object fails to correctly link to preparations associated with an interaction. Attempting to click on these referenced preparations results in an infinite loading dialog without displaying any data.

    To Reproduce Steps to reproduce the behavior:

    1. Add CO preparations to an interaction (e.g. gift)
    2. Go to the CO and try to delete
    3. Click on the referenced preparations
    4. See dialog box

    Expected behavior The deletion blocker should properly load the interaction preparation table. Also, I think it would be more helpful for the user if it referenced back to the entire interaction, not just the preparation table (e.g., referencing the gift itself rather than the gift preparation).

    Screenshots

    Screen.Recording.2024-07-01.at.1.09.42.PM.mov
    Please, also fill out the following information manually:

    • OS: macOS 14.5
    • Browser: Chrome
    • Specify 7 Version: edge
    • Database Name: KUMammals_2024_06_06
    • Collection name: Mammalogy
    • User Name: spmamadmin

    #5062 (comment)

  4. emenslin commented on Aug 6, 2024

    @emenslin

    Can recreate in edge (7.9.6)

  5. emenslin commented on Dec 26, 2024

    @emenslin

    Happening in ojsmnh with agent having a blocker for collector (same as first video)

    eMT6HtiV0X.mp4
  6. added this to the 7.12.3 milestone on Oct 13, 2026
  7. linked a pull request that will close this issuefeat: paginate delete blockers #8238on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

1 - BugIncorrect behavior of the product2 - FormsIssues that are related to the form system

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions