I sumbitted this long time ago and although it looks like it was fixed (it updates the modeline), I just noticed that it still doesn't update `org-clock-current-task` and I think it should, because otherwise there's no way of accessing current-task value from outside of org-mode and outside of Emacs.
Let's say I want to show current task in a third-party bar like yabar or lemonbar.
Calling this
'emacsclient -e \"(if org-clock-current-task (string-trim (substring-no-properties (org-clock-get-clock-string))) ' )\"
would not work for a task that was refiled by a capture template.
I'm sorry for nitpicking - I would have tried fixing it myself, I tried diving into the code and I was quickly amazed how complex Org-mode's code is. No wonder no one has ever succeeded in replicating it for other editors.
Thank you guys for all amazing hard work that doesn't get appreciated enough.