Skip to content

Conversation

@taooceros
Copy link
Member

resolves #680

@taooceros taooceros self-assigned this Sep 6, 2021
@JohnTheGr8
Copy link
Member

We should probably keep TermSeperater and ActionKeywordSeperater around with an Obsolete attribute, so that this is not a breaking change, unless we can justify a major version bump of the plugin package with more changes...

Also, I don't think it's a good idea to change Terms to not include the action keyword... some plugins might depend on this being the case (I know my Github plugin does, for example) and I don't see any significant upside in breaking them with this change.

@taooceros
Copy link
Member Author

I still consider terms include actionkeyword as a design limitation. Probably we can add a new api SearchTerms, which removes the actionkeyword, and mark Terms as obsolete to keep backward compatibility.

@jjw24 jjw24 added enhancement New feature or request review in progress Indicates that a review is in progress for this PR labels Sep 16, 2021
@jjw24
Copy link
Member

jjw24 commented Sep 20, 2021

I think this change is breaking the GitHub plugin, can we provide backwards compatibility please:

12:27:42.3390+10:00 - FATAL - UnHandledException -

Exception

System.NullReferenceException: Object reference not set to an instance of an object.
   Source: FSharp.Core
   TargetAssembly: FSharp.Core, Version=4.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
   TargetModule: FSharp.Core.dll
   TargetSite: Microsoft.FSharp.Collections.FSharpList`1[T] ofArray[T](T[])
   at Microsoft.FSharp.Primitives.Basics.List.ofArray[T](T[] arr) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\local.fs:line 542
   at Microsoft.FSharp.Collections.ListModule.OfArray[T](T[] array) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\list.fs:line 112
   at Flow.Plugin.Github.GithubPlugin.Flow.Launcher.Plugin.IPlugin.Query(Query query) in C:\projects\flow-plugin-github\src\GithubPlugin.fs:line 148
   at Flow.Launcher.Plugin.IPlugin.<>c__DisplayClass3_0.<Flow.Launcher.Plugin.IAsyncPlugin.QueryAsync>b__0() in /_/Flow.Launcher.Plugin/Interfaces/IPlugin.cs:line 35
   at System.Threading.Tasks.Task`1.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 192
--- End of stack trace from previous location ---
   at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 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 211
   at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass111_0.<<QueryResults>g__QueryTask|2>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 563
--- End of stack trace from previous location ---
   at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 527
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_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)

@taooceros
Copy link
Member Author

I think this change is breaking the GitHub plugin, can we provide backwards compatibility please:

12:27:42.3390+10:00 - FATAL - UnHandledException -

Exception

System.NullReferenceException: Object reference not set to an instance of an object.
   Source: FSharp.Core
   TargetAssembly: FSharp.Core, Version=4.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
   TargetModule: FSharp.Core.dll
   TargetSite: Microsoft.FSharp.Collections.FSharpList`1[T] ofArray[T](T[])
   at Microsoft.FSharp.Primitives.Basics.List.ofArray[T](T[] arr) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\local.fs:line 542
   at Microsoft.FSharp.Collections.ListModule.OfArray[T](T[] array) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\list.fs:line 112
   at Flow.Plugin.Github.GithubPlugin.Flow.Launcher.Plugin.IPlugin.Query(Query query) in C:\projects\flow-plugin-github\src\GithubPlugin.fs:line 148
   at Flow.Launcher.Plugin.IPlugin.<>c__DisplayClass3_0.<Flow.Launcher.Plugin.IAsyncPlugin.QueryAsync>b__0() in /_/Flow.Launcher.Plugin/Interfaces/IPlugin.cs:line 35
   at System.Threading.Tasks.Task`1.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 192
--- End of stack trace from previous location ---
   at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 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 211
   at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass111_0.<<QueryResults>g__QueryTask|2>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 563
--- End of stack trace from previous location ---
   at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 527
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_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)

Sure, probably I write something wrong.

@JohnTheGr8
Copy link
Member

The now-obsolete Terms is not being updated in the Query constructor, so it ends up being null...

@taooceros
Copy link
Member Author

The now-obsolete Terms is not being updated in the Query constructor, so it ends up being null...

I add the parameter, but forget to assign it to the field🤣😂

@jjw24
Copy link
Member

jjw24 commented Sep 27, 2021

this is causing the clipboard plugin to crash:

System.ArgumentOutOfRangeException
  HResult=0x80131502
  Message=Specified argument was out of the range of valid values. (Parameter 'length')
  Source=System.Private.CoreLib
  StackTrace:
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument)
   at System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray[T](T[] array, Range range)
   at Flow.Launcher.Plugin.Query.get_SecondToEndSearch() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Plugin\Query.cs:line 84
   at Flow.Launcher.Plugin.ClipboardHistory.ClipboardHistory.<>c__DisplayClass3_0.<Query>b__0(String i)
   at System.Linq.Enumerable.WhereListIterator`1.ToList()
   at Flow.Launcher.Plugin.ClipboardHistory.ClipboardHistory.Query(Query query)
   at Flow.Launcher.Plugin.IPlugin.<>c__DisplayClass3_0.<Flow.Launcher.Plugin.IAsyncPlugin.QueryAsync>b__0() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Plugin\Interfaces\IPlugin.cs:line 35
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<<QueryForPluginAsync>b__0>d.MoveNext() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 192
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Flow.Launcher.Infrastructure.Stopwatch.<DebugAsync>d__3.MoveNext() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 34
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Flow.Launcher.Core.Plugin.PluginManager.<QueryForPluginAsync>d__22.MoveNext() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 191
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass111_0.<<QueryResults>g__QueryTask|2>d.MoveNext() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 553
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Flow.Launcher.ViewModel.MainViewModel.<QueryResults>d__111.MoveNext() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 527
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_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)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at Flow.Launcher.App.Main() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\App.xaml.cs:line 43

  This exception was originally thrown at this call stack:
    System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument)
    System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray<T>(T[], System.Range)
    Flow.Launcher.Plugin.Query.SecondToEndSearch.get() in Query.cs
    Flow.Launcher.Plugin.ClipboardHistory.ClipboardHistory.Query.AnonymousMethod__0(string)
    System.Linq.Enumerable.WhereListIterator<TSource>.ToList()
    Flow.Launcher.Plugin.ClipboardHistory.ClipboardHistory.Query(Flow.Launcher.Plugin.Query)
    Flow.Launcher.Plugin.IPlugin.Flow.Launcher.Plugin.IAsyncPlugin.QueryAsync.AnonymousMethod__0() in IPlugin.cs
    System.Threading.Tasks.Task<TResult>.InnerInvoke()
    System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, object)
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    ...
    [Call Stack Truncated]

@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Oct 17, 2021
@jjw24 jjw24 added this to the 1.9.0 milestone Oct 17, 2021
@jjw24 jjw24 merged commit 2a68a41 into dev Oct 17, 2021
@jjw24 jjw24 deleted the QueryTermsRefactor branch October 17, 2021 21:10
@jjw24 jjw24 added bug Something isn't working and removed enhancement New feature or request labels Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query.Terms should not include actionkeyword

4 participants