To avoid this situation, some projects require their contributors to sign contributor license agreement. Terms might differ, but generally you allow your contribution to be relicensed in any way in the future. So today Matrix's AGPL, tomorrow they can go proprietary and you're OK with that. Also they want to sell their source code with proprietary license (so buyer's not obliged to open his modifications) and they also need contributor permission to do that.
Basically it's a commercial project which is not interested with external contributions.