this.afterRefresh() is not a function

It was unclear from your post if you were thinking it was coming from plugins or core.

Can’t help much without having access to code. But what you said is right sendAction is deprecated and shouldn’t be used anymore, actions are now simple closures.