From 74c75c6d3a1c3934cd3d6622d3b8efd5f4594e27 Mon Sep 17 00:00:00 2001 From: Jordi Enric <37541088+jordienr@users.noreply.github.com> Date: Tue, 14 Jul 2026 18:24:30 +0200 Subject: [PATCH 1/7] fix(studio): cap errors-since-last-deploy log range to 24h DEBUG-173 (#47911) ## Problem The edge function overview's "Errors since last deploy" panel queried ClickHouse from the deploy timestamp to now, with no upper bound. When a function had not been redeployed in a long time, this produced an unbounded query range, which is suspected to have caused a recent uptime incident. ## Fix `getSinceLastDeployLogRange` now clamps the query start to at most 24 hours before now, shared by all three queries this panel issues (invocation list, invocation count, runtime logs). The section title was also updated from "Errors since last deploy" to "Errors in the last 24h" to reflect the new bound. ## How to test - Open an edge function's overview page for a function that was deployed more than 24 hours ago - Confirm the "Errors in the last 24h" panel loads without an excessively large query range - Expected result: the panel only queries the last 24 hours of logs regardless of how old the last deploy was - Run `pnpm test:studio -- EdgeFunctionRecentErrors.utils` and confirm the range-clamping tests pass ## Summary by CodeRabbit - **New Features** - Updated the Edge Function errors section to show errors from the last 24 hours. - **Bug Fixes** - Limited error log searches to a maximum 24-hour window, preventing outdated results from appearing. - Improved handling of error time ranges when the last deployment occurred earlier than the available window. --- .../EdgeFunctionOverview/EdgeFunctionRecentErrors.tsx | 2 +- .../EdgeFunctionRecentErrors.utils.test.ts | 7 +++++++ .../EdgeFunctionRecentErrors.utils.ts | 10 +++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionOverview/EdgeFunctionRecentErrors.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionOverview/EdgeFunctionRecentErrors.tsx index 8333ec6445a5c..9233c5e4edb6e 100644 --- a/apps/studio/components/interfaces/Functions/EdgeFunctionOverview/EdgeFunctionRecentErrors.tsx +++ b/apps/studio/components/interfaces/Functions/EdgeFunctionOverview/EdgeFunctionRecentErrors.tsx @@ -204,7 +204,7 @@ export const EdgeFunctionRecentErrors = ({
- Errors since last deploy + Errors in the last 24h