[firebase_ai] Response fails to parse when a urlMetadata entry has no urlRetrievalStatus

Open Beginner friendly
#18,908 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
dart, flutter
Domain
mobile

Research direction

Start in the firebase_ai code path at _parseUrlMetadata and inspect how UrlRetrievalStatus._parseValue handles JSON values. The issue describes the failure when urlRetrievalStatus is absent and the expected behavior: treat the missing status as unknown. Add or update a test for a urlMetadata entry without that field and confirm parsing succeeds.

Written by the indexing model from the issue text.

Description

In firebase_ai 5.1.0, _parseUrlMetadata passes jsonObject['urlRetrievalStatus'] to UrlRetrievalStatus._parseValue, which throws type 'Null' is not a subtype of type 'Object' when the field is absent. Proto3 JSON leaves out default enum values, so an UNSPECIFIED status can arrive that way, and the whole response is lost rather than one entry. Treating a missing status as unknown would fix it.

Dominant language
Dart
Stars
9.3k
Forks
4.1k
Avg merge
1d 9h
Merged PRs (30d)
69

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/flutterfire

All issues in firebase/flutterfire

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.