SitecorePowerShell / Console

Sitecore PowerShell Extensions
https://doc.sitecorepowershell.com/
Other
114 stars 71 forks source link

[XMC] Autocomplete doesn't work in cloud environment #1351

Closed alan-null closed 2 months ago

alan-null commented 2 months ago

Expected Behavior

Selected entry from suggestions window pasted into editor

Actual Behavior

Empty string/whitespaces pasted image

Steps to Reproduce the Problem

video with steps https://github.com/user-attachments/assets/c0e82c14-3331-4e29-98db-7e49b0a49f77

Dev notes:

It looks like this piece of code behaves differently for onPrem and XMC image

resulting in different decision for the following if statement

image

The difference is caused by this command TabExpansion2 "[linkmana" 9 returning different results

logs:

ManagedPoolThread #7 15:33:11 WARN  Exception calling "CompleteInput" with "3" argument(s): "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."At line:38 char:16
+ ...      return [System.Management.Automation.CommandCompletion]::Complet ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exception: System.Management.Automation.MethodInvocationException
Message: Exception calling "CompleteInput" with "3" argument(s): "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."
Source: System.Management.Automation
   at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
   at CallSite.Target(Closure , CallSite , Type , String , Int32 , Hashtable )
   at System.Management.Automation.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

Nested Exception

Exception: System.Reflection.ReflectionTypeLoadException
Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source: mscorlib
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.Assembly.GetTypes()
   at System.Management.Automation.CompletionCompleters.<>c.<InitializeTypeCache>b__111_0(Assembly assembly)
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Management.Automation.CompletionCompleters.InitializeTypeCache()
   at System.Management.Automation.CompletionCompleters.CompleteType(CompletionContext context, String prefix, String suffix)
   at System.Management.Automation.CompletionAnalysis.GetResultHelper(CompletionContext completionContext, Int32& replacementIndex, Int32& replacementLength, Boolean isQuotedString)
   at System.Management.Automation.CompletionAnalysis.GetResults(PowerShell powerShell, Int32& replacementIndex, Int32& replacementLength)
   at System.Management.Automation.CommandCompletion.CompleteInputImpl(Ast ast, Token[] tokens, IScriptPosition positionOfCursor, Hashtable options)
   at CallSite.Target(Closure , CallSite , Type , String , Int32 , Hashtable )

45496 15:33:26 INFO  Arbitrary script execution in ISE by user: 'sitecore\Admin'
AdamNaj commented 2 months ago

Unfortunately, we don't have access to the XMC account to test it, so regretfully for now we have to put it in the "cannot fix" category :(