inveniosoftware / react-invenio-app-ils

Single Page App built with React for InvenioILS.
https://react-invenio-app-ils.readthedocs.io
MIT License
5 stars 19 forks source link

Data integrity issue #399

Closed nkenobi closed 3 years ago

nkenobi commented 3 years ago

Package version (if known): Latest (29)

Describe the bug

Started to look into the React SearchKit with this project as an example and found an issue where the updated values are not consistently reflected back in Search results.

Steps to Reproduce

  1. Using the demo data, perform a search under "Physical Items" on say "cryptography" - it gives 2 items both of which are "Not on Loan"
  2. Again using demo data, go to Loans and with same search for "cryptography", go to Details screen of any Pending Loan request for one of the demo users.
  3. Checkout the copy - everything shows updated status - so far so good.
  4. Now go back to the Search screen for "Physical Items" and again search for "cryptography" - it still shows the same 2 items with "Not on Loan"
  5. But go to Details screen for the "Physical Item" and it shows "On Loan" (as expected).

Expected behavior

The search in Step 4 above should show 1 item on "Not on Loan" and 1 item on "On Loan"

Screenshots (if applicable)

Attached

Additional context

Wasn't sure if it is a problem with React Search Kit, DB, API/query issue or application problem such as caching. So I tried to narrow it down as follows: Restarted the app to flush all stale values, also restarted DB/Docker and Server, but still same inconsistency in Search result and Details result.

Am attaching screen shots but it is not difficult to reproduce.

nkenobi commented 3 years ago

Prior to checkout - Details screen

Items Search
nkenobi commented 3 years ago

Prior to checkout - search results

Items Search Post
nkenobi commented 3 years ago

After checkout - details

CheckedOut
nkenobi commented 3 years ago

After checkout - search

Items Search Post
ntarocco commented 3 years ago

HI! Thank you for reporting this issue and the other one. We will have a look on Monday, but from a very quick reading of the issue, do you have celery running in a console? Every time you perform an action, you will need to have celery pushing updated data to Elasticsearch.

nkenobi commented 3 years ago

Indeed, that seems to do the trick.

Thanks for the quick response.