Skip to content

Revert refactoring changes that broke remoting to Windows PowerShell 5.1 - #5321

Merged
Dongbo Wang (daxian-dbw) merged 3 commits into
PowerShell:masterfrom
SteveL-MSFT:remoting-callback
Nov 9, 2017
Merged

Dongbo Wang (daxian-dbw) merged 3 commits into
PowerShell:masterfrom
SteveL-MSFT:remoting-callback

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

Call backs depend on private members to have the same name across versions of PowerShell. Specifically fixes prompts and clear.

Paul Higinbotham (@PaulHigin) are there other callbacks I need to fix? I noticed that ctrl+c doesn't work from PSCore6 to Windows PowerShell 5.1.

Fix #4615

@lzybkr Jason Shirk (lzybkr) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh - it's silly that the protocol requires the names of the private fields. I suppose it's just an expedient implementation detail - just use reflection, but it's so brittle.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Jason Shirk (@lzybkr) I agree now that I've learned how this aspect of the protocol works

public sealed
class ChoiceDescription
{
// DO NOT REMOVE OR RENAME THESE FIELDS - it will break remoting

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the warning messages should say "it will break remoting compatibility with Windows PowerShell".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incomplete. To fully fix this incompatibility we need to revert field names for all encoded class/structs. Here is the supported list:
https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs#L41

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reused an existing comment. I can update all occurrences of that comment to be more specific. Thanks for the pointer to the list of types, I'll fix those as well.

@TravisEz13

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) One of the commits is not linked to your github account.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Travis Plunk (@TravisEz13) fixed

public sealed
class ChoiceDescription
{
// DO NOT REMOVE OR RENAME THESE FIELDS - it will break remoting compatibility with Windows PowerShell compatibility with Windows PowerShell

@mirichmo Mike Richmond (mirichmo) Nov 6, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about putting these fields within a region to make the grouping more explicit? The "Do Not Remove or Rename" region?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Will make an update.

@SteveL-MSFT Steve Lee (SteveL-MSFT) added this to the 6.0.0-RC milestone Nov 7, 2017
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Travis Plunk (@TravisEz13) can you merge?

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit b194731 into PowerShell:master Nov 9, 2017
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the remoting-callback branch November 12, 2017 05:17
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…5.1 (PowerShell#5321)

- Revert refactoring changes so that it doesn't break remoting to Windows PowerShell 5.1
- Fix the rest of the supported types for remoting
- Put remoting sensitive private members in a descriptive region
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remoting host callbacks incompatible between PowerShell 5.1 and 6.0

6 participants