MongooseIM icon indicating copy to clipboard operation
MongooseIM copied to clipboard

gen_mod:start_backend_module/3 requires TrackedFuncs to have corresponding -callback attrs but doesn't state so

Open erszcz opened this issue 6 years ago • 2 comments

MongooseIM version: at least 3.3.0 and later

gen_mod:start_backend_module/3 (and likely the underlying backend_module:create/3) requires TrackedFuncs to have corresponding -callback attributes defined in the module passed as Module argument, but doesn't state so anywhere.

This leads to confusion, since even if the TrackedFuncs are correct, the *_rdbms (or equivalent) exports the expected implementations, the *_backend proxy module still doesn't export them if -callbacks are missing.

erszcz avatar Jul 03 '19 08:07 erszcz

@erszcz do you have a solution to this problem in mind? The only thing which comes to my mind at this moment is to crash (with a descriptive error message) the proxy module creation if we notice that there is a TrackedFunc without corresponding -callback.

michalwski avatar Feb 05 '20 13:02 michalwski

@michalwski I think that would work very well!

erszcz avatar Feb 05 '20 13:02 erszcz