stevencohn / OneMore

A OneNote add-in with simple, yet powerful and useful features
Mozilla Public License 2.0
2.42k stars 202 forks source link

Is Manage Favorites Broken? #1446

Open jasonjac2 opened 5 days ago

jasonjac2 commented 5 days ago

How can I help you?

I have 2 machines where Manage Favorites is broken BUT I think it might be me not you :-).

I have a process where I maintain favorites on one machine and then every month I back them up and copy them into the install of the other couple of machines I have. This worked great, but the original seed machine died and the 2 machines I currently have them copied to - the favs works well, but the Manage Fav's has an empty listbox, i.e. no fav's in it.

I have no idea when this started as I have moved machines, updated the OneMore and only really noticed about a month ago.

So the Q is, does manage fav's work for most people and if it is just me, how best to remedy it..

I have about 30 entries in my favs and am on the latest version of OM.

Version 6.4.0 with OneNote 16.0.17628.20144 Actually, if I go into manage favs and hten OK I get: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.NullReferenceException: Object reference not set to an instance of an object. at River.OneMoreAddIn.Settings.FavoritesSheet.CollectSettings() at River.OneMoreAddIn.Settings.SettingsDialog.OK(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at River.OneMoreAddIn.UI.MoreButton.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at River.OneMoreAddIn.UI.MoreButton.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

THE FINE PRINT This is a hobby project that I started for myself. I'm happy to take requests and will promise to consider each one carefully but offer no guarantees that I will ultimately agree to their usefulness or have time to implement any of them. If OneNote offers a "close enough" work-around then I will probably reject the request - you've been warned!

stevencohn commented 3 days ago

I've seen something like this before where a bad link in the favorites can break that dialog. Remember that Manage Favorites tries to validate each link upon loading. A bad link in this case might be due to the fact that different machines might generate different page or object IDs - something Microsoft got wrong in my opinion!

It should have logged the offending entry in the OneMore.log file. Do you see any log statements just above that exception?

There is a bunch of exception handling in there but, clearly, I need to beef it up even more!

jasonjac2 commented 3 days ago

Actually, I was just being impatient it would appear. My 30 favorites take 30 plus seconds to render. This is the favourites file stolen from one of my other PC's and about 50 are yellow and 50 are grey (I can't remember which are down as broken links), BUT they all navigate fine. So my 2 x take aways:

For You possible Fix: Ensure you are checking the list has been built before attempting to do whatever you are doing with the list once I hit OK. For Me & you - what makes the favourites JSON file not portable. Those pages that are broken are in the same notbook as ones that are fine AND the pages haven't changed names.
For Me - rebuild my fav's from the ground up.