Skip to content

Updated Service response to EnablePrjFS request#1151

Merged
alameenshah merged 1 commit into
microsoft:masterfrom
alameenshah:fix_issue_1053
May 14, 2019
Merged

Updated Service response to EnablePrjFS request#1151
alameenshah merged 1 commit into
microsoft:masterfrom
alameenshah:fix_issue_1053

Conversation

@alameenshah
Copy link
Copy Markdown
Contributor

Service (RequestHandler.cs) on the Mac, was sending responses to EnableProjFS requests in an incorrect format. This was causing gvfs service --mount-all to fail with “un-expected response message” error. Updated RequestHandler to first create a Message object from EnableProjFS Response and use it in its reply to client. This helps create a client parsable response with expected header and body.

Service response before the change -
GVFS.Common.NamedPipes.NamedPipeMessages+EnableAndAttachProjFSRequest+Response

Service response after the change -
TRequestResponse|{\"State\":1,\"ErrorMessage\":null}”}

Fixes #1053

@alameenshah alameenshah requested a review from jamill May 13, 2019 19:10
@alameenshah alameenshah self-assigned this May 13, 2019
@alameenshah alameenshah added this to the M153 milestone May 13, 2019
@jamill
Copy link
Copy Markdown
Member

jamill commented May 13, 2019

Thanks! The change and explanation look straight forward enough. Is there any tests we could add to cover this behavior?

Copy link
Copy Markdown
Member

@kewillford kewillford left a comment

Choose a reason for hiding this comment

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

Are there any unit or functional tests that we can write for this change?

@jeschu1
Copy link
Copy Markdown
Member

jeschu1 commented May 13, 2019

We have several service functional tests turned off, does it make sense to turn any on with this PR https://github.com/microsoft/VFSForGit/blob/master/GVFS/GVFS.FunctionalTests/Tests/MultiEnlistmentTests/ServiceVerbTests.cs

[TestCase]
public void ServiceHandlesEnablePrjfsRequest()
{
string expectedServiceResponse = "TRequestResponse|{\"State\":1,\"ErrorMessage\":null}";
Copy link
Copy Markdown
Contributor Author

@alameenshah alameenshah May 13, 2019

Choose a reason for hiding this comment

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

Let me know if this string looks too strict (making the test fragile.)

Copy link
Copy Markdown
Member

@jamill jamill left a comment

Choose a reason for hiding this comment

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

Thanks!

@alameenshah
Copy link
Copy Markdown
Contributor Author

Thanks! The change and explanation look straight forward enough. Is there any tests we could add to cover this behavior?

Ideally we should be having UT for all the Service Request Handler classes. Created a ticket for that.

For this specific PR, I've added a new test in MacServiceTests (which has other generic UT for .netcore target classes) to include a new test for EnablePrjFS handler response.

Comment thread GVFS/GVFS.UnitTests/Service/Mac/MacServiceTests.cs Outdated
@wilbaker
Copy link
Copy Markdown
Member

If we haven't created a milestones/M152 branch yet, should this PR be marked as M152?

cc: @jrbriggs

@jamill jamill mentioned this pull request May 14, 2019
15 tasks
Service (RequestHandler.cs) on the Mac, was sending responses to
EnableProjFS requests in an incorrect format. This was causing
`gvfs service --mount-all` to fail with "un-expected response
message" error. Updated RequestHandler to first create a Message
object from EnableProjFS Response and use it in its reply to
client. (It was sending string representation of the response
before.) This helps create a client parsable response with
expected header and body.

Also added new UT in MacServiceTests.

Service response before the change -
`GVFS.Common.NamedPipes.NamedPipeMessages+EnableAndAttachProjFSRequest+Response`

Service response after the change -
`TRequestResponse|{\"State\":1,\"ErrorMessage\":null}`

Fixes #1053
@jrbriggs jrbriggs modified the milestones: M153, M152 May 14, 2019
@alameenshah alameenshah merged commit 836bff2 into microsoft:master May 14, 2019
@wilbaker
Copy link
Copy Markdown
Member

@alameenshah what was the verdict on this comment?

We have several service functional tests turned off, does it make sense to turn any on with this PR https://github.com/microsoft/VFSForGit/blob/master/GVFS/GVFS.FunctionalTests/Tests/MultiEnlistmentTests/ServiceVerbTests.cs

cc: @jeschu1

@jrbriggs jrbriggs modified the milestones: M152, M153 May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gvfs service --mount-all fails on Mac

6 participants