Sorry if this has been reported already, I didn't check the old forums for the topic, and I didn't get any response on IRC.
It seems once you've been locked on to by a ranged mob, drinking an invisibility potion doesn't stop them from attacking you, even if you run out of their range and return shortly after. I know this is the case with Goblin Archers, and I assume it applies to all ranged mobs.
Can this be fixed?
No, it can't. It has to do with range of perception and the way AI is handled.