Odotocodot / Flow.Launcher.Plugin.OneNote

A OneNote plugin for Flow Launcher.
MIT License
10 stars 2 forks source link

Plugin crashes as I start entering "on {" #1

Closed acneupane closed 1 year ago

acneupane commented 1 year ago

I wanted to use the on {onenote search query} and as I start typing "on {" then the plugin crashes by saying "Flow Launcher got an error" with the following info to post.

  1. upload log file. 2023-01-15.txt
  2. copy below exception message

Flow Launcher version: 1.11.0 OS Version: Microsoft Windows NT 10.0.22621.0 IntPtr Length: 8 x64: True

Python Path: C:\Program Files\Python311\pythonw.exe Node Path: C:\Program Files\nodejs\node.exe Date: 01/15/2023 10:56:53 Exception: OneNote Exception: Websites: https://github.com/Odotocodot/Flow.Launcher.Plugin.OneNote Author: Odotocodot Version: 1.0.0 Flow.Launcher.Core.ExternalPlugins.FlowPluginException: 0x80042019 ---> System.Runtime.InteropServices.COMException (0x80042019): 0x80042019 at Microsoft.Office.Interop.OneNote.ApplicationClass.FindPages(String bstrStartNodeID, String bstrSearchString, String& pbstrHierarchyXmlOut, Boolean fIncludeUnindexedPages, Boolean fDisplay, XMLSchema xsSchema) at ScipBe.Common.Office.OneNote.OneNoteProvider.<>cDisplayClass4_0.b0(Application oneNote) at ScipBe.Common.Office.OneNote.OneNoteProvider.CallOneNoteSafely[T](Func`2 action) at ScipBe.Common.Office.OneNote.OneNoteProvider.FindPages(String searchString) at Flow.Launcher.Plugin.OneNote.OneNotePlugin.Query(Query query) at Flow.Launcher.Plugin.IPlugin.<>cDisplayClass3_0.b0() in /_/Flow.Launcher.Plugin/Interfaces/IPlugin.cs:line 35 at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<<QueryForPluginAsync>b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 191 --- End of stack trace from previous location --- at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 40 at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 213 --- End of inner exception stack trace --- at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 213 at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass135_0.<gQueryTask|2>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 821 --- End of stack trace from previous location --- at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 785 at System.Threading.Tasks.Task.<>c.b128_0(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Odotocodot commented 1 year ago

It seems that { is a invalid query when using FindPages from the ScipBe library and Microsoft Interop. Also you dont have to start you searches with {. For on {onenote search query} the curly brackets just represent anything you type next will be used. e.g. on hello world will search your notes for hello world. The very pixelated gif has examples at the end of it.

Odotocodot commented 1 year ago

Seems all symbols are a invalid character to start a search with. Will push a fix soon.