Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer lookup cache not invalidated when customer created #923

Open
donaldgray opened this issue Nov 21, 2024 · 0 comments
Open

Customer lookup cache not invalidated when customer created #923

donaldgray opened this issue Nov 21, 2024 · 0 comments
Labels
API https://dlcs-book.readthedocs.io/en/latest/ bug Something isn't working

Comments

@donaldgray
Copy link
Member

When a customer is created the CustomerPathElementRepository cache must be invalidated. The CreateCustomer request should implement IInvalidateCaches to do this. If Customer details are stored in any other API caches these should be invalidated too.

The caches are not currently invalidated on CustomerCreation, which can lead to unexpected behaviour when ingesting assets - the ingest should succeed but fails when raising a notification as the notification looks up Customer name and path.

Below are some notes from investigating this - note that there is nothing logged that explains the 500. We should add a 'catch-all' exception handler to log unexpected exceptions.


The behaviour seen was:

  • Asset PUT received
  • Logs show successful authentication
  • Logs show "Asset Created" notification raised
  • Final status code is 500
  • Looking at asset in DB shows asset is "ingesting" and incomplete
  • Engine is never called

Example log for CorrelationId 19cfdba1-4528-47e3-bae4-650e34468c00:

[06:27:10 DBG API.Auth.DlcsBasicAuthenticationHandler 19cfdba1-4528-47e3-bae4-650e34468c00] Using JWT with customer id 100
[06:27:10 DBG API.Auth.DlcsBasicAuthenticationHandler 19cfdba1-4528-47e3-bae4-650e34468c00] AuthenticationScheme: Basic was successfully authenticated.
[06:27:10 DBG API.Infrastructure.Messaging.AssetNotificationSender 19cfdba1-4528-47e3-bae4-650e34468c00] Message Bus: Asset Created: 100/1/62-Portrait_of_Erasmus_by_Hans_Holbein_d._J.-Kunstmuseum_Basel.jpg
[06:27:10 ERR Serilog.AspNetCore.RequestLoggingMiddleware 19cfdba1-4528-47e3-bae4-650e34468c00] HTTP PUT /customers/100/spaces/1/images/62-Portrait_of_Erasmus_by_Hans_Holbein_d._J.-Kunstmuseum_Basel.jpg responded 500 in 12.1987 ms
@donaldgray donaldgray added bug Something isn't working API https://dlcs-book.readthedocs.io/en/latest/ labels Nov 21, 2024
@donaldgray donaldgray changed the title Customer lookup cache must be invalidated when customer created Customer lookup cache not invalidated when customer created Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API https://dlcs-book.readthedocs.io/en/latest/ bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant