Page MenuHomePhabricator

Value by key function Z803 fails for Key reference "Z1K1" on objects with some supported types (Z6, Z20, ?Z13518)
Open, MediumPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to https://www.wikifunctions.org/view/en/Z803
  • In the Try this function box, enter Z1K1 as the “reference” under “key” (you may need to fiddle with “key” to get the “reference” box to appear T360580)
  • In “type” under “object”, select “String”
  • In the (literal string) “object” box, enter a string (or not)
  • Click Run function

What happens?:
The result is Void. Click “Errors” to see the error(s): “Call tuples failed in returnOnFirstError. Error: TypeError: responseEnvelope.Z22K1.asJSON is not a function.”

What should have happened instead?:

The value associated with the Z1K1 key should have been returned ("Z6", interpreted (for consistency, see below) as a reference to the String type).

(Alternatively, a meaningful error result should have been returned.)

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Behaviour for other objects is not entirely consistent.
*For Z41 and Z42 a reference to Boolean ("Z40") is displayed.
*For a Natural number, a full Type is displayed, rather than (a link to) Z13518
*For a Typed list, the (generic type) function call is displayed
*For a Function call, the displayed result follows from the type of the call’s evaluation (although the error in Z866 is
“Call tuples failed in returnOnFirstError. Error: TypeError: Z1.getNameEphemeral is not a function.“)
*For types (generally), the displayed result is (a link to) Z4
*For Z20s, the result is a “Key not found” error, rather than (a link to) Z20

(This is not an exhaustive list.)

Where the value is a string/reference we should consider displaying the result as a literal as well as a reference (the value in the object’s specified key being a string and the reference being an interpretation of that string).

Please also see https://www.wikifunctions.org/view/en/Z15781. This may be a separate bug, but the test shows as “Passed”, with Details being:
Reached time limit in orchestrator
Error type: Reached time limit in orchestrator

Editing the source, it seems always to produce this result for the Z4K1 of Natural number so long as the Key reference is either "Z1K1" or "Z6K1". This suggests that the initial (Z4K1) call to Z803 is returning a String object and the second call is timing out. However, trying Z803 with Z4K1 on Z13518 currently times out (as it sometimes does with Z1K1), with Errors viewable.

Event Timeline

Good idea, thanks. I made:
*https://www.wikifunctions.org/view/en/Z15903 for a Boolean (passes)
*https://www.wikifunctions.org/view/en/Z15904 for a Natural number (fails: Z507 in result validation using Z13052/object equality). I was assuming that a reference was being returned and then expanded but I have a hunch that Natural number types are expanded before Z803 is executed and Z803 is simply returning the type object that it finds associated with the Z1K1. Given the apparent performance overhead with expanded types (if my hunch is correct), I think it might be better to continue with the “inconsistency”. Attempting to extract the Z4K1 from the Z1K1 of a Natural number currently times out, however (Z574), so I have left the test case failing (and consistent).
*https://www.wikifunctions.org/view/en/Z15905 for a test case (fails: Z507 with Z511 in Z507K2 in actual result)

This comment was removed by GrounderUK.