Page MenuHomePhabricator

Z7 with local keys has keys messed up when stored by API
Closed, DuplicatePublicBUG REPORT

Description

Description

Steps to reproduce:

  1. Send a request to API to create a new composition implementation for Z10339 which contains a Z7 like this:
{
    "Z1K1": "Z7",
    "Z7K1": {
        "Z1K1": "Z18",
        "Z18K1": {
	    "Z1K1": "Z6",
	    "Z6K1": "Z10339K1"
        }
    },
    "K1": {
        "Z1K1": "Z6",
	"Z6K1": "first input"
    },
    "K2": {
        "Z1K1": "Z6",
	"Z6K1": "second input"
    },
}

Observed behavior:

  • API stores the implementation, but with the "K2" key replaced by "Z7K2", i.e.
{
    "Z1K1": "Z7",
    "Z7K1": {
        "Z1K1": "Z18",
        "Z18K1": {
	    "Z1K1": "Z6",
	    "Z6K1": "Z10339K1"
        }
    },
    "K1": {
        "Z1K1": "Z6",
	"Z6K1": "first input"
    },
    "Z7K2": {
        "Z1K1": "Z6",
	"Z6K1": "second input"
    },
}

Expected behavior (Acceptance criteria):

  • It doesn't adjust the key.

Note
The reproduction step calls the API directly because T324597 means you cannot currently use the UI.


Completion checklist

Event Timeline

Re-tested just now with the following, and indeed it's still broken:

Function definition:

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10016"
    },
    "Z2K2": {
        "Z1K1": "Z8",
        "Z8K1": [
            "Z17",
            {
                "Z1K1": "Z17",
                "Z17K1": "Z1",
                "Z17K2": "Z10016K1",
                "Z17K3": {
                    "Z1K1": "Z12",
                    "Z12K1": [
                        "Z11"
                    ]
                }
            }
        ],
        "Z8K2": "Z1",
        "Z8K3": [
            "Z20"
        ],
        "Z8K4": [
            "Z14"
        ],
        "Z8K5": "Z10016"
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1199",
                "Z11K2": "function that takes a function"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}

Call as submitted:

{
    "Z1K1": "Z2",
    "Z2K1": "Z0",
    "Z2K2": {
        "Z1K1": "Z7",
        "Z7K1": {
            "Z1K1": "Z18",
            "Z18K1": "Z10016K1"
        },
        "K1": {
            "Z1K1": "Z6",
            "Z6K1": "first input"
        },
        "K2": {
            "Z1K1": "Z6",
            "Z6K1": "second input"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}

Call as persisted:

{
    "Z1K1": "Z2",
    "Z2K1": "Z10017",
    "Z2K2": {
        "Z1K1": "Z7",
        "Z7K1": {
            "Z1K1": "Z18",
            "Z18K1": "Z10016K1"
        },
        "Z7K2": "second input",
        "K1": "first input"
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}

Aha, we fixed this alongside T398457 six weeks ago. Yay.