jaysonsantosJ
ZITADEL6mo ago
12 replies
jaysonsantos

v4 fails to add metadata when using v1 action

Hey there folks, I just updated my self hosted playground to v4, using helm but setting the image version to v4 and it seems that v1 actions are broken.

The following code:
const uuid = require("zitadel/uuid");

function addUUID(ctx, api) {
  const userMetadata = ctx.v1.user.getMetadata();

  // Check if customer_id already exists in metadata
  if (userMetadata && userMetadata.metadata) {
    for (let i = 0; i < userMetadata.metadata.length; i++) {
      if (userMetadata.metadata[i].key === "customer_id") {
        return;
      }
    }
  }

api.v1.user.setMetadata("customer_id", uuid.v4());
//  api.v1.user.setMetadata(ctx, "customer_id", uuid.v7());
}

Running on pre userinfo creation will fail with the following:
(char limit, check thread)
image.png
Was this page helpful?