Giter Club home page Giter Club logo

Comments (7)

noahdietz avatar noahdietz commented on July 23, 2024 2

Ok we've got a fix planned. It will come early next week. Sorry about the breakage, please continue to use 1.10 for now.

from gax-php.

PierrickVoulet avatar PierrickVoulet commented on July 23, 2024

FYI @fiboknacky @aohren

from gax-php.

PierrickVoulet avatar PierrickVoulet commented on July 23, 2024

Not sure if that helps but debugging the unit test that fail, I found that the ApiException instance is not created in the same way depending on the version of gax-php being used.

1.10.0: It uses the method createFromStdClass and the metadata is NULL.

image

1.11.2: It uses the method createFromRpcStatus and the metadata is a RepeatedField got from status.

image

from gax-php.

noahdietz avatar noahdietz commented on July 23, 2024

That definitely helps! That looks like the root cause.

from gax-php.

noahdietz avatar noahdietz commented on July 23, 2024

Actually, in looking at the create documentation, the $metadata may either be a PHP array OR a RepeatedField. So the fact that this is a RepeatedField is allowed.

from gax-php.

noahdietz avatar noahdietz commented on July 23, 2024

However, the documentation for ApiException constructor indicates $metadata should be an array.

hmm.

from gax-php.

noahdietz avatar noahdietz commented on July 23, 2024

Ok so we are thinking that the this is a bug in gax-php that has kind of been lurking.

ApiException::create is documented as accepting []mixed|RepeatedField for $metadata. That $metadata value is passed to ApiException::_construct untouched. ApiException::_construct documents that it expects $metadata to be an array, and ApiException::getMetadata documents the return type i.e. $metadata is []mixed.

So the bug is that ApiException::create needs to convert $metadata that's instanceof RepeatedField into an array prior to constructing the ApiException.

The problem was introduced because ServerStream::readAll was changed to construct an exception via ApiException::createFromRpcStatus whereas it was ApiException::createFromStdClass (a gRPC specific type) before. The former (the code recently released) supplies the Google/Rpc/Status::getDetails() directly to ApiException::create. Since it isn't "massaged" to the array type as I mentioned earlier, this whole issue popped up.

@bshaffer

from gax-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.