Repository navigation
Conversation
When the Samply tab opens, the web console checks for a profile with `GET /samply_profile?latest=true`. Before any profile, the pipeline answered 400 `NoSamplyProfile`, so each check put an error in the browser's network log. In feldera/cloud#2163, these errors sent an investigation of a failed support bundle the wrong way. With `latest=true`, a 204 No Content now means that there is no profile to download yet: with `Retry-After` if one is in progress, as before, and without it if none was started. Without `latest`, nothing changes. Also corrects the API docs, which said 307 for a profile in progress. Signed-off-by: Ben Pfaff <blp@feldera.com>
| const expectedInSeconds = parseInt(response.headers.get('Retry-After') ?? '') | ||
| const retryAfter = response.headers.get('Retry-After') | ||
| if (retryAfter === null) { | ||
| return null |
Contributor
There was a problem hiding this comment.
missing (medium): this new 204 branch is the client half of the contract, and no test covers it. The Rust test only checks the server. Here is a unit test I ran locally with vitest --project server (5/5 pass). It could go in as src/lib/services/samplyProfile.spec.ts:
import { afterEach, describe, expect, it, vi } from 'vitest'
import { getSamplyProfile } from '#lib/services/pipelineManager.ts'
const stubFetch = (response: Response) =>
vi.stubGlobal('fetch', Object.assign(vi.fn().mockResolvedValue(response), { preconnect: () => {} }))
describe('getSamplyProfile', () => {
afterEach(() => vi.unstubAllGlobals())
it('returns null on 204 without Retry-After', async () => {
stubFetch(new Response(null, { status: 204 }))
expect(await getSamplyProfile('p', true)).toBeNull()
})
it('returns expectedInSeconds on 204 with Retry-After', async () => {
stubFetch(new Response(null, { status: 204, headers: { 'Retry-After': '7' } }))
expect(await getSamplyProfile('p', true)).toEqual({ expectedInSeconds: 7 })
})
it('returns expectedInSeconds 0 on 204 with Retry-After: 0', async () => {
stubFetch(new Response(null, { status: 204, headers: { 'Retry-After': '0' } }))
expect(await getSamplyProfile('p', true)).toEqual({ expectedInSeconds: 0 })
})
it('throws on 204 with a malformed Retry-After', async () => {
stubFetch(new Response(null, { status: 204, headers: { 'Retry-After': 'soon' } }))
await expect(getSamplyProfile('p', true)).rejects.toThrow(/estimated time is not known/)
})
it('returns a download handle on 200', async () => {
stubFetch(new Response(new Uint8Array([1, 2, 3]), { status: 200, headers: {
'Content-Type': 'application/gzip', 'Content-Disposition': 'attachment; filename="p.json.gz"' } }))
const result = await getSamplyProfile('p', true)
expect(result && 'downloadPromise' in result).toBe(true)
})
})
Contributor
|
What I ran
Gates: the server change has a test, the changelog marks the incompatible change, and the API docs are fixed in the Rust source. I found no flaky tests, unsafe code or dependency changes.
Otherwise LGTM. |
mihaibudiu
approved these changes
Nov 11, 2026
This branch has not been deployed
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.
When the Samply tab opens, the web console checks for a profile with
GET /samply_profile?latest=true. Before any profile exists, the pipeline answered 400NoSamplyProfile. In feldera/cloud#2163 those 400s in the browser network log sent the support bundle investigation the wrong way.?latest=true, profile in progressRetry-After?latest=true, no profileNoSamplyProfileRetry-Afterlatest, no profileNoSamplyProfileRetry-Afteras "no profile".Multihost needs feldera/cloud#2207: the coordinator read a host's 204 as an empty profile.
Tests
samply_profile_latest_without_profileengine test. It fails (400 instead of 204) with the fix disabled.svelte-check: 0 errors. Prettier: clean.-- Claude Code, at @blp's request.