fix(postgrest): stop duplicating the package id in X-Client-Info - #418
Merged
Conversation
Util.GetAssemblyVersion already returns "{assembly}-csharp/{version}{metadata}",
so prefixing it with "postgrest-csharp/" emitted
"postgrest-csharp/supabase.postgrest-csharp/8.0.0" - three /-delimited
segments instead of two, with the package id twice. Consumers that split on
'/' read "supabase.postgrest-csharp" as the version.
Postgrest was the only call site doing this; the other five pass the helper
through unmodified. Align the fallback shape too, and update the test that
only passed because of the bug.
Tr00d
approved these changes
Sep 8, 2026
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.
Problem
Helpers.PrepareRequestHeadersprefixed the shared header helper with a literalpostgrest-csharp/:Util.GetAssemblyVersion(Core/Util.cs:33) already returns{assemblyname-lowercased}-csharp/{version}{metadata}. The emitted header was therefore:The package id appears twice, and the value has three
/-delimited segments instead of two. Any consumer that splits on/reads the version slot assupabase.postgrest-csharp.Scope
Postgrest was the only outlier. The other five call sites pass the helper through unmodified and are correct:
Storage/StorageBucketApi.cs:39Gotrue/Api.cs:43Functions/Client.cs:180Realtime/RealtimeSocket.cs:84Supabase/Client.cs:296,Supabase/StatelessClient.cs:167So the fix belongs in Postgrest, not in
Util.Change
Util.GetAssemblyVersion(typeof(Client))through as-is.supabase.postgrest-csharp/session-{AppSession}.RequestHeaderTests.cs:62assertedStartWith("postgrest-csharp/"). That passed only because of the bug — the assembly name isSupabase.Postgrest, so the corrected header starts withsupabase.postgrest-csharp/. Updated to match, which mirrorsFunctions.Tests/ClientContractTests.cs:116(supabase.functions-csharp/).Impact
Confirmed against production telemetry (
supabase-etl-prod-eu.dbt.supabase_client_lib_requests): this is the largest C# request bucket, roughly 648M requests/30d on v4 plus 31k on v8.Open item: downstream telemetry parsing
The header shape changes for every Postgrest request once this ships, so the dbt mart likely needs a compensating change:
supabase.postgrest-csharp/8.x.x.postgrest-csharp/supabase.postgrest-csharp/4.x.x.If the mart splits on
/and takes index 1 as the version, it will keep mis-parsing history and start parsing new rows correctly — so a period of mixed shapes needs handling either way. A parser that takes the last/-delimited segment as the version, or that strips a leadingpostgrest-csharp/when a second-csharp/segment follows, handles both.I could not verify the actual model: the only accessible dbt repo (
supabase/dbt) is private and archived since 2023, and does not contain asupabase_client_lib_requestsmodel. Someone with access to the live mart should confirm before this is released.Testing
Not run locally — no .NET SDK on this machine. CI covers
Postgrest.Tests.