fix(alerts): repair 404 on View full logs anomaly link#193
Merged
TerrifiedBug merged 1 commit intomainfrom Apr 28, 2026
Merged
Conversation
The "View full logs" button on the anomaly error context panel pointed to /pipelines/[id]/logs, which doesn't exist as a route. Logs are rendered inline on /pipelines/[id] via a togglable side panel. - Change href to /pipelines/[id]?logs=1 - Read ?logs=1 in the pipeline page to initialize logsOpen=true so the panel auto-opens on deep-link navigation
| const [discardOpen, setDiscardOpen] = useState(false); | ||
| const [metricsOpen, setMetricsOpen] = useState(false); | ||
| const [logsOpen, setLogsOpen] = useState(false); | ||
| const [logsOpen, setLogsOpen] = useState(() => searchParams.get("logs") === "1"); |
Contributor
There was a problem hiding this comment.
useSearchParams requires a Suspense boundary
Next.js requires any component that calls useSearchParams() to be wrapped in a <Suspense> boundary; without one, the entire route tree de-opts from partial prerendering (PPR) and Next.js emits a build warning (MISSING_SUSPENSE_WITH_CSR_BAILOUT). Since PipelineBuilderInner is already nested inside ReactFlowProvider, the simplest fix is to wrap it in Suspense inside PipelineBuilderPage:
import { Suspense } from "react";
export default function PipelineBuilderPage() {
const params = useParams<{ id: string }>();
return (
<ReactFlowProvider>
<Suspense>
<PipelineBuilderInner pipelineId={params.id} />
</Suspense>
</ReactFlowProvider>
);
}Prompt To Fix With AI
This is a comment left during a code review.
Path: src/app/(dashboard)/pipelines/[id]/page.tsx
Line: 203
Comment:
**`useSearchParams` requires a Suspense boundary**
Next.js requires any component that calls `useSearchParams()` to be wrapped in a `<Suspense>` boundary; without one, the entire route tree de-opts from partial prerendering (PPR) and Next.js emits a build warning (`MISSING_SUSPENSE_WITH_CSR_BAILOUT`). Since `PipelineBuilderInner` is already nested inside `ReactFlowProvider`, the simplest fix is to wrap it in `Suspense` inside `PipelineBuilderPage`:
```tsx
import { Suspense } from "react";
export default function PipelineBuilderPage() {
const params = useParams<{ id: string }>();
return (
<ReactFlowProvider>
<Suspense>
<PipelineBuilderInner pipelineId={params.id} />
</Suspense>
</ReactFlowProvider>
);
}
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Notion bug: 404 on "View full logs" under anomaly alerts.
The link in
error-context-panel.tsxpointed at/pipelines/[id]/logswhich is not a route — pipeline logs render inline on/pipelines/[id]via a togglable side panel./pipelines/[id]?logs=1?logs=1in/pipelines/[id]/page.tsxto initializelogsOpen=trueso the panel auto-opens on deep-link navigationTest plan
/pipelines/[valid-id]?logs=1→ logs panel open by default/pipelines/[valid-id]→ logs panel closed by default (no regression)Greptile Summary
This PR fixes a 404 by correcting the "View full logs" link in
error-context-panel.tsxfrom the non-existent/pipelines/[id]/logsroute to/pipelines/[id]?logs=1, and reads that query param inpage.tsxto auto-open the logs side panel on deep-link navigation. The core fix is correct and the lazyuseStateinitialiser is the right pattern for one-shot URL-driven state.Confidence Score: 4/5
Safe to merge — the fix is correct and the only finding is a missing Suspense wrapper that generates a build warning but does not cause a runtime failure.
Only P2 findings present; score stays at 4/5 per the P2-only ceiling guidance.
src/app/(dashboard)/pipelines/[id]/page.tsx — needs a Suspense boundary around PipelineBuilderInner to satisfy Next.js App Router requirements for useSearchParams.
Important Files Changed
/pipelines/[id]/logsroute with the correct/pipelines/[id]?logs=1deep-link URL.useSearchParamsto read?logs=1and initialiselogsOpenstate; missing<Suspense>wrapper around the consuming component will cause a Next.js build warning.Sequence Diagram
sequenceDiagram participant User participant AlertPanel as ErrorContextPanel participant PipelinePage as /pipelines/[id]/page User->>AlertPanel: clicks "View full logs" AlertPanel->>PipelinePage: navigate to /pipelines/[id]?logs=1 PipelinePage->>PipelinePage: useSearchParams().get("logs") === "1" PipelinePage->>PipelinePage: useState initialiser → logsOpen = true PipelinePage->>User: renders with logs panel openPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(alerts): repair "View full logs" 404..." | Re-trigger Greptile