Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stable sendTo value source in NotificationDetails.vue #1454

Open
AutumnSun1996 opened this issue May 28, 2023 · 0 comments
Open

Use stable sendTo value source in NotificationDetails.vue #1454

AutumnSun1996 opened this issue May 28, 2023 · 0 comments

Comments

@AutumnSun1996
Copy link

default:
return {
value: asArray(Object.values(props.data)[0]),
icon: 'BellIcon',
}

Currently, sendTo in NotificationDetails will use a random value from props.data for most BlockType, it will cause inconsistecy in different deploy of prefect server instances.

In my PR PrefectHQ/prefect#9547 , which add a CustomWebhookNotificationBlock, both name and url can becomes the value displayed at sendTo depends on database type(postgresql jsonb type will not keep key order of object, which may be the root cause).

Using sqlite:
image

Using postgresql:
image

I think it's better to use something like this, so the value source of sendTo is stable:

          // try name, url in order, or blockName is non exists.
          value: asArray(
            props.data.name ||
            props.data.url ||
            props.blockType.name
          ),

Or, still use Object.values(props.data)[0] in place of props.blockType.name for backword compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant