Skip to content

fix(auditing): add missing base.OnModelCreating() call in AuditDbContext#1228

Merged
iammukeshm merged 1 commit into
developfrom
fix/audit-dbcontext-base-call
Mar 26, 2026
Merged

fix(auditing): add missing base.OnModelCreating() call in AuditDbContext#1228
iammukeshm merged 1 commit into
developfrom
fix/audit-dbcontext-base-call

Conversation

@iammukeshm
Copy link
Copy Markdown
Member

Summary

  • Adds the missing base.OnModelCreating(modelBuilder) call in AuditDbContext, ensuring Finbuckle's multi-tenant query filters are properly activated for audit records.
  • Without this call, the .IsMultiTenant() configuration on AuditRecord was never converted into actual EF Core query filters, risking cross-tenant data leakage.
  • Aligns with the established pattern used by IdentityDbContext and TenantDbContext.

Note: The issue also mentions broken soft-delete filtering, but AuditRecord does not implement ISoftDeletable, so that claim does not apply.

Closes #1226

Test plan

  • Verify dotnet build src/FSH.Framework.slnx succeeds
  • Verify dotnet test src/FSH.Framework.slnx passes
  • Confirm audit queries are tenant-isolated with the fix applied

🤖 Generated with Claude Code

Without the base call, Finbuckle's MultiTenantDbContext.OnModelCreating()
was never invoked, which means the .IsMultiTenant() configuration on
AuditRecord was not activated into actual query filters — risking
cross-tenant data leakage for audit records.

Closes #1226

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@iammukeshm iammukeshm merged commit b4fa0fe into develop Mar 26, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AuditDbContext.OnModelCreating() does not call base.OnModelCreating()

1 participant