Other related issues about trusted foxes: MC-166787 and MC-157212
As of 1.15 Pre-Release 2, trusting foxes only defend players from bow-armed mobs, crossbow-armed mobs and melee mobs but will no longer defend players from any sort of attacks. But they will ignore hoglins/zoglins, though they use melee as their attack.
Can confirm in 1.17.1.