obj.respond_to? :method_name isn't working correctly
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 40/100
Rechercherichtung
Beginne damit, das Verhalten mit shopify_api Version 13.4 unter Verwendung des product API object und der respond_to? steps im Issue zu reproduzieren. Verfolge, wie respond_to? true, false oder T::Private::Types::Void::VOID erzeugt; abgeschlossen ist die Aufgabe, wenn es konsistent true oder false zurückgibt und ein nicht unterstützter Aufruf NoMethodError auslöst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Issue summary
When using api_object.respond_to?(:method_name) the lib sometimes returns true and sometimes returns T::Private::Types::Void::VOID Sorbet private void type. It seems that true was returned if the method name had been previously used to dereference the object but on more inspection I am not so sure that's the case.
shopify_apiversion: 13.4- Ruby version:
- Operating system:
Expected behavior
When calling respond_to? with a method name the object should return true if the object is able to respond to the method call or false if it is not, and if you call the method name on the object after it returns false it should raise a NoMethodError
Actual behavior
Sometimes the response is true, sometimes it's a private Sorbet type T::Private::Types::Void::VOID, and sometimes it switches from the private type to true after you dereference the object with the method in question.
Steps to reproduce the problem
- Instantiate an api object (I used a product)
- Invoke
respond_to?on it (api_object.respond_to? :some_bs_method) - Bonus points - try invoking the method on the object after receiving the Sorbet type as a response and then calling
respond_to?with the method name, it was returning true for me after doing so
- Vorherrschende Sprache
- Ruby
- Sterne
- 1.1k
- Forks
- 487
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Shopify/shopify-api-ruby
-
devtools-gardener
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Shopify/shopify-api-ruby#1456 · 3 Reaktionen ·
-
Allow configuring open/read timeouts for API requestsEvtl. vergeben @fluke hat das vor 18 Tagen übernommen. Offendevtools-gardener
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
Shopify/shopify-api-ruby#1466 · 1 Kommentar ·
-
automated
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
Shopify/shopify-api-ruby#1465 ·
-
oj dependency breaks support for JRubyEvtl. vergeben @najibna hat das vor 31 Tagen übernommen. Offendevtools-gardener
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 67/100
Shopify/shopify-api-ruby#1461 · 1 Kommentar ·
-
automated
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Shopify/shopify-api-ruby#1460 ·
Alle Issues in Shopify/shopify-api-ruby
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug community
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
DataDog/dd-trace-rb#6536 ·
Maintainer antworten meist innerhalb von 1 Tag