I understand on the reflow thoughts, but how did my tapping the box, mounted in the bike, make my solder flow reattach? We did get the magnifying glass out and checked the joints, they looked good under there.
that's why a solid whack of the J-Box would get the failed unit to again function at least temporarily.
when you initially experience the lack of headlight symptom, the "whack" test forces a momentary contact on the failed solder joint, that is all it takes to cause the current flow to actuate the relay to latch on, and produce resultant lighting circuit connection..
mind you, i have examined these elusive bad solder joints with a magnafying glass, and simply cannot see all of the cracks that would cause this, I know it sounds silly, and you would think it visible, but most of the time it's just not visible, but re-soldering did fix the problems.
I also agree with tony, that if time allows, ordering and replacing the relay is a viable action, but on the road, 500 miles from home, on a ride, simply re-soldering repairs the problem to get you home, so don't discount the viability when it occurs.....a soldering iron from wally world comes in handy and can be obtained a lot easier en-route than relays....and will likely get ya home.