cds-snc / platform-forms-client

NextJS application that serves the public-facing website for Forms
https://forms-staging.cdssandbox.xyz/
MIT License
28 stars 12 forks source link

Duplicate Audit Log Events #3855

Closed bryan-robitaille closed 4 days ago

bryan-robitaille commented 1 week ago

In the latest app router release we are seeing audit log event conflicts. Identical logs are being created within the same millisecond. This is usually caused by async functions referencing the same resource in different code paths.

Screenshot 2024-06-18 at 8.39.55 AM.png

Although related to #3668 these audit log conflicts should be easier to resolve and are removed from the scope of the Database Performance issue.

bryan-robitaille commented 1 week ago

The getFullTemplateByID was being called multiple times in a single render causing identical audit logs.

Untitled.png

I'll be refactoring to use the client side Template Store as the source of truth as much as possible where the current function is called.