bug(realtime): array converters throw past their catch on a JSON array with a bad element
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with IntArrayConverter and StringArrayConverter, then compare their reader handling with the PostgresNestedArrayConverter fix in #436. Reproduce the bad-element, object, and string-literal cases in Model(); done means invalid JSON array input no longer loses the record or causes a read-too-much/read-too-little exception, while the string-literal path still returns null.
Written by the indexing model from the issue text.
Description
IntArrayConverter and StringArrayConverter return null for anything they cannot read, but only on the string-literal path. On the JSON path a failing element leaves the reader half way through the array, and an object in place of the array is never consumed, so System.Text.Json throws "read too much or not enough" after Read returns and the whole record fails in Model<T>().
{"favorite_numbers":[1,"x"]} // JsonException, record lost
{"favorite_numbers":{}} // same
{"favorite_numbers":"{1,x}"} // null, as intended
Fix is the one PostgresNestedArrayConverter got in #436: copy the reader before the try, and in the catch rewind it and Skip(); Skip() in the default branch too.
- Dominant language
- C#
- Stars
- 701
- Forks
- 106
- Avg merge
- 16h 35m
- Merged PRs (30d)
- 45
Contributor guide
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 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
supabase/supabase-csharp#427 ·
-
supabase/supabase-csharp#409 · 1 comment · 1 assignee ·
-
area: realtime bug parity
supabase/supabase-csharp#393 · 1 assignee ·
-
bug
supabase/supabase-csharp#377 · 3 comments · 1 assignee ·
All issues in supabase/supabase-csharp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100