sillsdev / DesktopAnalytics.net

Wrapper around segment.io's Analytics.net specifically for desktop apps (instead of servers).
5 stars 6 forks source link

TXL-183: Improved robustness of code for retrieving existing Analytics User ID from a different channel of the same program. #13

Closed tombogle closed 7 years ago

tombogle commented 7 years ago

This prevents crash (null reference exception) when GetEntryAssembly returns null and generally prevents any failure in this code from throwing a fatal exception. The new code actually tries two different approaches. The first approach will NOT work for plugins or calls from unmanaged code, but for maximum compatibility (to keep from breaking Bloom), we try it first. If it fails, we try the second approach, which should work for everyone (though until there is a plugin that supports channels, it will presumably never actually find a pre-existing config file from a different channel).

hatton commented 7 years ago

Times like this it feels like refactoring and code-review are incompatible. I could probable review what you did in 10 minutes, but it's not possible to tell what that is, so instead I need to find 45 mintues at somet point to review everything in green...

tombogle commented 7 years ago

True. Unfortunately, most of the refactoring was really necessary to achieve the desired result. If you want, I can try to walk through it code-review style with someone here, and you can accept their approval as authoritative.

tombogle commented 7 years ago

I did consider trying to add unit tests. Maybe I should.

hatton commented 7 years ago

Sure, try to grab Andrew. Thanks.