parity(auth): return null from session storage on JSON parse failure [from supabase-js]
Maintainers usually reply within 1 day
@Tr00d is already working on this.
Since Jul 1, 2026.
Assessment
This issue has not been assessed yet.
Description
[!WARNING]
Auto-generated parity issue — may be a false positive.This issue was created automatically by
/sync-sdk-parityfrom a heuristic analysis of recentsupabase-jscommits. The tooling has limited insight into language-specific idioms and may have:
- misidentified a JS-only change as cross-language relevant,
- missed an existing implementation in this SDK under a different name,
- or proposed an API shape that doesn't fit this language's conventions.
It is the SDK author's responsibility to validate the need before implementing. If this change does not apply to this SDK, please close the issue with a short note explaining why.
SDK Parity: C# implementation needed
A defensive fix was made in supabase-js auth that may apply to this repository. Please confirm applicability before starting work.
Reference Implementation (supabase-js)
- Commit:
0c227a1 - PR: supabase/supabase-js#2336
- Module: auth
- Type: bug-fix (resilience)
What Changed
Session-storage reader returns null on JSON parse failure, treating corrupted entries as absent rather than crashing downstream.
Implementation Guidance (C#)
private Session? ReadSessionFromStorage()
{
var raw = _storage.GetItem(_storageKey);
if (raw == null) return null;
try
{
return JsonSerializer.Deserialize<Session>(raw);
}
catch (JsonException)
{
return null; // Corrupted — treat as no session
}
}
Key Behaviors to Match
- Invalid JSON in session storage →
null, not exception
Acceptance Criteria
- Corrupted session storage returns
null, not throws - Test verifies the behavior
Context
- supabase-js version: v2.106.0
- Related: SDK-1038 (dart), SDK-1039 (py), SDK-1040 (swift)
- Parity tracking: Auto-generated by
/sync-sdk-parity
- Dominant language
- C#
- Stars
- 701
- Forks
- 106
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 35
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/supabase-csharp
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
supabase/supabase-csharp#440 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
supabase/supabase-csharp#437 ·
Maintainers usually reply within 1 day
-
bug(gotrue): FailureReason matches english messages instead of error_codePossibly taken @Tr00d claimed this 22 days ago. Open
supabase/supabase-csharp#409 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
OAuth State Error for social providers since Supabase.Gotrue v6.1.0May be free again @Tr00d claimed this 33 days ago, and no pull request is open. Openbug
supabase/supabase-csharp#377 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Postgres Changes filters are validated as anon because SetAuth is applied after channel joinMay be free again @Tr00d claimed this 45 days ago, and no pull request is open. Openarea: postgrest bug
supabase/supabase-csharp#345 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in supabase/supabase-csharp
Similar issues
-
area-System.Numerics.Tensors untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/runtime#134691 · 2 comments ·
Maintainers usually reply within 1 day
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AvaloniaUI/Avalonia#22312 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100