mitydigital / statamic-logger

Detailed, customisable and human-friendly audit logging for Statamic
MIT License
2 stars 1 forks source link

Unable to Retrieve User from Queue-Triggered Events Due to Lack of Session Awareness #3

Closed mikeschoneveld closed 1 month ago

mikeschoneveld commented 1 month ago

When events are triggered by the queue, it is not possible to retrieve the user because the queue is not session-aware. This presents a significant challenge for handling user-specific tasks and ensuring the correct user context is maintained throughout the process.

martyf commented 1 month ago

Unfortunately I don't have a solution to this one as it's not really within the scope of the addon given it's the way Laravel and Statamic work.

I get exactly what you mean though, but just don't have an answer.

The handler only receives the event, so has either the logged in user (if sync), or the event itself (and whatever data it contains). But the events themselves do not carry the user reference.

Is there a specific event that is problematic?

mikeschoneveld commented 1 month ago

@martyf ok thanks, we will use sync.