Vendor identity is keyed on email domain, not the exact email
What happens
When inviting a vendor, Clearline checks whether the invited email already belongs to an existing vendor account. It checks for an exact email match first; if there isn't one, and the email's domain isn't a personal/generic webmail domain, it falls back to matching by domain. If any vendor already has an account at that domain, the invite is treated as another contact at that same company — the flow won't silently create a disconnected duplicate. Instead it stops and tells the admin who the existing contact is, and the vendor's name on file always wins over whatever company name was typed on this particular invite.
Why
A company's Clearline identity should be the company, not whichever individual happened to get invited first. Two different districts inviting two different people at @abcstaffing.com should land on the same vendor account, not create two disconnected ones. Personal/generic email providers (gmail.com, yahoo.com, outlook.com, icloud.com, protonmail.com, and others — full list in src/lib/emailDomain.ts) have no shared company identity to key on, so those addresses only ever match by exact email, never by domain.
Where in the code
src/app/api/invite-vendor/route.ts (identity resolution ~lines 27–45, the "different contact, existing company" response ~lines 59–80); domain exclusion list in src/lib/emailDomain.ts.
Testing gotcha
This makes @theclearline.io itself risky to test against with plus-aliasing. theclearline.io is not on the personal-domain list, so every karen+N@theclearline.io invite resolves to the same company identity — you can't use plus-aliases on Clearline's own work domain to simulate multiple distinct fake vendors; they all collide into one. For that, plus-alias a real personal webmail address instead (e.g. karen+testco1@gmail.com, karen+testco2@gmail.com) — gmail.com is on the exclusion list, so matching falls back to exact email and each alias is a fully independent identity. Bonus: it's a real inbox, so you can also click through the actual invite/magic-link email if you need to test that far.