SSHOC / sshoc-marketplace-backend

Code for the backend
Apache License 2.0
2 stars 0 forks source link

Submitted items do not appear in moderation queue #477

Closed mkrzmr closed 1 month ago

mkrzmr commented 1 month ago

To reproduce:

Submit item to moderation queue with role contributor Check moderation queue as moderator The item does not show api request https://marketplace-api.sshopencloud.eu/api/item-search?page=1&order=modified-on&d.status=SUGGESTED returns 0 hits

Critical, as new items cannot be approved via the ui anymore

laureD19 commented 1 month ago

just reproduced on the stage instance. Indeed... Do you see anything in the database, though, based on the timestamps activities?

mkrzmr commented 1 month ago

here is the log output:

18-10-2024 08:08:27.270 [http-nio-8080-exec-552] DEBUG e.s.m.services.search.SearchService.searchItems - filterParams {} 18-10-2024 08:08:27.272 [http-nio-8080-exec-552] DEBUG e.s.m.s.s.query.SearchQueryPhrase.getQueryCriteria - Original query false:

mkrzmr commented 1 month ago

I'll check the db when I am back, just on my way to the airport

stefanprobst commented 1 month ago

can you please check whether this is a backend of frontend issue (because i did update the frontend node.js version yesterday)

mkrzmr commented 1 month ago

Here is what the frontend produces:

{"id":71589,"category":"tool-or-service","label":"test","persistentId":"TiTMkg","lastInfoUpdate":"2024-10-18T08:49:06+0000","status":"suggested","informationContributor":{"id":3657,"username":"8b0dec30-1cdd-4e15-af64-c41a3292c8b1@myaccessid.org","displayName":"Michael Kurzmeier","status":"enabled","registrationDate":"2024-10-18T08:48:05+0000","role":"contributor","config":false},"description":"I want to suggest this tool","contributors":[],"properties":[],"externalIds":[],"accessibleAt":[],"relatedItems":[],"media":[]}

So this looks as expected, and I see no errors in the frontend, but

GET https://sshoc-marketplace-api-stage.acdh-dev.oeaw.ac.at/api/item-search?page=1&order=modified-on&d.status=suggested&d.conflict-at-source=false

does not return the tool. That's why I thought I was a backend issue

KlausIllmayer commented 1 month ago

It is a combination of frontend changes and backend behavior. You can see in the frontend-url that you sent, that since the last update of frontend the field d.conflict-at-source is taken into account. It is set here as false but it seems, that this is not the correct value. Because if you run the API call without this parameter api/item-search?page=1&order=modified-on&d.status=suggested you will see all of the suggested items. And I think I know, why this is happening, because most of the items do not have set the property conflict-at-source and when asking for false it will look for items that do have set the property but with the value false. We introduced this the last days as it is necessary for the management of the ingested items.

@stefanprobst if it is possible to change the current behavior, so that instead of setting it to false when the checkbox is not activated the reference to d.conflict-at-source=false is not applied to the parameters?

stefanprobst commented 1 month ago

if it is possible to change the current behavior, so that instead of setting it to false when the checkbox is not activated the reference to d.conflict-at-source=false is not applied to the parameters?

yes - although the current behavior is modeled after d.deprecated-at-source - i think at some point we should align these.

stefanprobst commented 1 month ago

can you try again please?

fixed by (hopefully) https://github.com/SSHOC/sshoc-marketplace-frontend/commit/c082e1f6ebc9baf3a67c67ba4e683a5c88ff3a23

KlausIllmayer commented 1 month ago

When trying out on stage I still see that there is the API call api/item-search?page=1&order=modified-on&d.status=suggested&d.conflict-at-source=false which means, as d.conflict-at-source=false is used, that it still does not work as expected. I wonder, why there is conflict-at-source whereas deprecated-at-source is not there.

stefanprobst commented 1 month ago

what page are we talking about here? /moderate-items?

stefanprobst commented 1 month ago

misunderstood my own code from the past :) please try again.

KlausIllmayer commented 1 month ago

yes, now it works - thanks!