Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of PercyDOM.snapshot() is not supported by .NET client #42

Closed
LSViana opened this issue Nov 24, 2022 · 2 comments · Fixed by #43
Closed

Return value of PercyDOM.snapshot() is not supported by .NET client #42

LSViana opened this issue Nov 24, 2022 · 2 comments · Fixed by #43
Assignees
Labels
🐛 bug Something isn't working

Comments

@LSViana
Copy link

LSViana commented Nov 24, 2022

(This issue was originally created in percy/cli, but it was moved here under request.)

The problem

The .NET Percy library doesn't know how to handle the object returned by Percy CLI in version 1.15.0, which was just a plain string previously.

Environment

  • Node version:
  • @percy/cli version: 1.15.0
  • Version of Percy SDK you’re using: .NET PercyIO.Selenium 1.0.0
  • If needed, a build or snapshot ID: N/A
  • OS version: Windows 11 (22621.819)
  • Type of shell command-line [interface]: Windows Terminal

Details

The code to take snapshot fails with an exception that has the following message:

Unable to cast object of type  System.Collections.Generic.Dictionary`2[System.String,System.Object]' to type 'System.String'.

Because the .NET client declares a string variable to store the result returned by the PercyDOM.serialize() method, but in v1.15.0 it started returning an object instead.

Debug logs

There are no logs from the CLI because the .NET client fails to process the result of PercyDOM.serialize(), therefore it never contacts the CLI to post a snapshot.

Code to reproduce issue

Use PercyIO.Selenium v1.0.0 with @percy/cli@1.15.0 (the latest available of both tools) to check the issue happening.

Extra

It is possible that this issue affects SDKs of other languages too if they're also expecting a string.

It's not a problem to me that the Percy team introduced breaking changes but, when doing that, please publish updates to the SDKs to help customers fix the problems quickly.

@LSViana LSViana changed the title Return value of PercyDOM.snapshot() is not supported by C# client Return value of PercyDOM.snapshot() is not supported by .NET client Nov 24, 2022
@itsjwala itsjwala self-assigned this Nov 24, 2022
@itsjwala itsjwala added the 🐛 bug Something isn't working label Nov 24, 2022
@itsjwala
Copy link
Contributor

@LSViana please give the latest version a try, the issue should be resolved.

@LSViana
Copy link
Author

LSViana commented Dec 28, 2022

@itsjwala Sorry for the delay to answer. After I rolled back the versions last month and things were working again, I switched my focus to other business priorities.

I just updated the implementation on my side to use the PercyIO.Selenium v1.1.0 and @percy/cli v1.16.0 and the integration is working correctly now.

Thank you for the support! 🙋‍♂️

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 a pull request may close this issue.

2 participants