novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
35.43k stars 3.92k forks source link

fix(api): Nv 4823 no validation around bad urls + 400 in client #7092

Closed tatarco closed 17 hours ago

tatarco commented 1 day ago

What changed? Why was the change needed?

  1. we now validate URLs
  2. in case of a single placeholder in a url we will mock a fake URL for the framwork to render it.
  3. in case of a corrupt URL we will remove it and place an issue, the framwork will not render it but an error will be evident
  4. we validate the URL to start with either http / https all the rest are issues and will be truncated.
  5. framework erros are no longer availble in the dev tools, they can be found in the log / sentry as they are masked now as 500 errors

Screenshots

Error exmpale

{
  "statusCode": 500,
  "timestamp": "2024-11-20T15:36:19.322Z",
  "path": "/v2/workflows/test-workflow-name_wf_fYOnYTUH296v4aIp/step/in-app-step-should-not-fail_st_fYOnYTUH296v4aIl/preview",
  "message": "Internal server error, contact support and provide them with the errorId",
  "errorId": "a04eb17b-6444-4cfd-85a3-48d8f2677526"
}
Expand for optional sections ### Related enterprise PR ### Special notes for your reviewer
linear[bot] commented 1 day ago

NV-4823 No validation around bad URL's

netlify[bot] commented 1 day ago

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
Latest commit 05a88f4fb5644b05c011a45d934522ddf4bad908
Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/673f14247f4e9500085b658f
Deploy Preview https://deploy-preview-7092--novu-stg-vite-dashboard-poc.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

pkg-pr-new[bot] commented 22 hours ago

Open in Stackblitz

@novu/client

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/client@7092 ```

@novu/framework

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/framework@7092 ```

@novu/js

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/js@7092 ```

@novu/headless

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/headless@7092 ```

@novu/nextjs

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/nextjs@7092 ```

@novu/node

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/node@7092 ```

@novu/notification-center

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/notification-center@7092 ```

novu

``` pnpm add https://pkg.pr.new/novuhq/novu@7092 ```

@novu/providers

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/providers@7092 ```

@novu/react

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/react@7092 ```

@novu/react-native

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/react-native@7092 ```

@novu/shared

``` pnpm add https://pkg.pr.new/novuhq/novu/@novu/shared@7092 ```

commit: 05a88f4