Vulcan icon indicating copy to clipboard operation
Vulcan copied to clipboard

`vulcan:users` runs callbacks with incorrect calling convention

Open jimrandomh opened this issue 6 years ago • 1 comments

In packages/vulcan-users/lib/server/on_create_user.js, onCreateUserCallback tries to run the same callbacks that createMutator would. Unfortunately, it runs a subtly different set and ordering of callbacks, and omits most of the arguments they would normally be passed.

The right way to do this would be to call createMutator (finding some way to provide a context), sharing code and ensuring matching calling conventions.

jimrandomh avatar Feb 27 '19 02:02 jimrandomh

Oh good point. I think I just forgot to change that when I recently cleaned up how mutator callbacks work.

I agree it'd be better to call createMutator, once we refactor Accounts maybe it'll be easier to use the same mutators for users as well.

SachaG avatar Feb 27 '19 12:02 SachaG