You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(plugin-audit): inherit organization_id from audited record when session lacks tenantId
Audit rows were being written with organization_id=NULL whenever the
session's activeOrganizationId wasn't populated (background jobs, first
requests post-signin, sudo paths). Combined with the SecurityPlugin's
RLS predicate that gates reads on organization_id matching the current
user's tenant, this made the audit log UI appear permanently empty even
though writes succeeded — historical /api/v1/data/sys_audit_log queries
returned 0 rows despite the underlying table holding thousands of
entries.
Falls back to the audited record's own organization_id (from after for
insert/update, before for delete), so the audit row is always at least
as scoped as the record it describes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments