ContributionFixes an undefined variable bug where four `db=session` references in the chats model use an out-of-scope `session` instead of the correct `db` parameter, preventing successful chat deletion and shared chat operations.
ImpactUsers who delete chats will no longer see misleading error messages or leave orphaned shared chat snapshots behind, because the database calls now correctly reference the passed connection. Chat deletion, shared-chat listing, opening shared chats, and adding chat tags all failed silently or threw errors due to the same variable scoping bug. Operators should verify that existing orphaned shared snapshots from before this fix are cleaned up or re-synced.