mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-09 08:10:08 +09:00
33c4b726e7
Opening a direct room looked for an existing one by loading every direct room on the account and comparing its member ids in Ruby, two queries per room, on each click. The cost grows with the account: about 0.3 s at 1,000 direct rooms and 3 s at 10,000. Asking SQL for the room among the first user's memberships whose member set is exactly the given users finds the same room in one query, however many direct rooms there are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JVFo3Lt9T8M5NR7KxVvsZ2