Page MenuHomePhabricator

Orchestrator throws `s.match is not a function` error
Closed, ResolvedPublicBUG REPORT

Description

Description

Steps to reproduce (step by step instructions, with links, commands and necessary data to reproduce the error)

  1. look here
  2. weep

Observed behavior

  • s.match is not a function

Expected behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)

  • I guess we thought that s was a string
  • so we should figure out why s was not a string

Completion checklist

Event Timeline

The underlying error here is an incorrect return value in a community-defined implementation.

The function is https://www.wikifunctions.org/view/en/Z24074, whose attached implementation (https://www.wikifunctions.org/view/en/Z24090) returns the following value:

	return {
		"Z1K1": {
			"Z1K1": "Z9",
			"Z9K1": "Z6091"
		},
		"Z6091K1": {
			"Z1K1": {
				"Z1K1": "Z9",
				"Z9K1": "Z6"
			},
			"Z6K1": list[Z23419K1]
		}
	}

This means that the Wikidata QID's Z6091K1 looks like

{
  "Z1K1": {
    "Z1K1": "Z9",
    "Z9K1: "Z6"
  },
  "Z6K1": {
    "Z1K1": "Z6",
    "Z6K1": "QXXX"
  }
}

which is degenerate.

This same function has another (detached) implementation, which returns a correctly-formatted value:

	return {
		"Z1K1": {
			"Z1K1": "Z9",
			"Z9K1": "Z6091"
		},
		"Z6091K1": list[Z23419K1]
	};

This produces objects like

{
  ...
  "Z6091K1": {
    "Z1K1": "Z6",
    "Z6K1": "QXXX"
  }
}

which are correct (i.e., the Z6091K1 has a correctly-formatted Z6).

I have since corrected the connected implementation.

Thanks, Cory. I created this implementation specifically for T392338. Sorry if it was causing problems elsewhere. The linked implementation, Z23421, may also cause a similar problem. I have raised T395308 for consideration, motivated by the behaviour of Z23421, which will insist on passing all the function tests.

Thanks, Cory. I created this implementation specifically for T392338. Sorry if it was causing problems elsewhere. The linked implementation, Z23421, may also cause a similar problem. I have raised T395308 for consideration, motivated by the behaviour of Z23421, which will insist on passing all the function tests.

Thanks! Yes, I think that T23421 will cause similar behaviors. Please amend that implementation, too, if you have time!

Separately, I'll float the idea of doing some output validation on evaluated code. We should be able to see this happening and surface an error indicating which implementation returned degenerate output.

I have also filed https://phabricator.wikimedia.org/T395527, which should let us catch these kinds of subtle bugs in the appropriate spot.

@cmassaro, could you please close this if it is resolved?

@cmassaro, could you please close this if it is resolved?

Done.