From 34ca001b5859917905828a23fa93aab37e33f555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daphn=C3=A9=20Popin?= Date: Tue, 28 Nov 2023 15:32:21 +0100 Subject: [PATCH] Cap message limit (#2690) * Cap messages per user at 50 / 3 hours * Display it on price table * Update wording --- front/lib/api/assistant/pubsub.ts | 4 ++-- front/pages/w/[wId]/subscription/index.tsx | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/front/lib/api/assistant/pubsub.ts b/front/lib/api/assistant/pubsub.ts index ffcf50e10c7c..4540949b9138 100644 --- a/front/lib/api/assistant/pubsub.ts +++ b/front/lib/api/assistant/pubsub.ts @@ -52,8 +52,8 @@ export async function postUserMessageWithPubSub( let timeframeSeconds: number | undefined = undefined; let rateLimitKey: string | undefined = ""; if (auth.user()?.id) { - maxPerTimeframe = 256; - timeframeSeconds = 60 * 60; + maxPerTimeframe = 50; + timeframeSeconds = 60 * 60 * 3; rateLimitKey = `postUserMessageUser:${auth.user()?.id}`; } else { maxPerTimeframe = 512; diff --git a/front/pages/w/[wId]/subscription/index.tsx b/front/pages/w/[wId]/subscription/index.tsx index a1fbba51a70f..cc7360a88606 100644 --- a/front/pages/w/[wId]/subscription/index.tsx +++ b/front/pages/w/[wId]/subscription/index.tsx @@ -7,6 +7,7 @@ import { Spinner, } from "@dust-tt/sparkle"; import { GetServerSideProps, InferGetServerSidePropsType } from "next"; +import Link from "next/link"; import { useRouter } from "next/router"; import React, { useContext, useEffect } from "react"; @@ -256,6 +257,9 @@ export default function Subscription({ ))} + + Terms of use apply to all plans. + ) : (