percy / cli

The Percy CLI is used to interact with, and upload snapshots to, percy.io via the command line.
https://docs.percy.io/docs/cli-overview
71 stars 45 forks source link

Return value of PercyDOM.snapshot() is not supported by clients #1142

Closed LSViana closed 1 year ago

LSViana commented 1 year ago

The problem

The C# 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

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 C# 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 C# 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.

itsjwala commented 1 year ago

Thanks for raising the issue @LSViana and apologies for the inconvenience, we'll be checking this on priority.

itsjwala commented 1 year ago
LSViana commented 1 year ago

Sure, @itsjwala! I just created #42 on the .NET repository.

I'll be closing this issue now.