Skip to content

dataconnect(fix): Fix serialization of *nullable* AnyValue#7864

Merged
dconeybe merged 2 commits intomainfrom
dconeybe/dataconnect/AnyValueNullableListElementFix
Mar 4, 2026
Merged

dataconnect(fix): Fix serialization of *nullable* AnyValue#7864
dconeybe merged 2 commits intomainfrom
dconeybe/dataconnect/AnyValueNullableListElementFix

Conversation

@dconeybe
Copy link
Copy Markdown
Contributor

@dconeybe dconeybe commented Mar 3, 2026

This change fixes an UnsupportedOperationException that occurred when serializing lists of nullable AnyValue.

The exception looked like this:

java.lang.UnsupportedOperationException: The AnyValueSerializer class cannot actually be used; it is merely a sentinel that gets special treatment during Data Connect serialization

Highlights

  • Fix UnsupportedOperationException when serializing lists of nullable AnyValue.
  • Use encodeSerializableValue in OptionalVariable.
Changelog
  • CHANGELOG.md: Added an entry for the fix.
  • OptionalVariable.kt: Use encodeSerializableValue to allow special casing of AnyValueSerializer.
  • ProtoStructDecoder.kt: Special case AnyValueSerializer in ProtoValueDecoder to avoid an UnsupportedOperationException.

Without this fix, attempting to serialize or deserizlize a List of nullable AnyValue would produce this exception:

```
java.lang.UnsupportedOperationException: The AnyValueSerializer class cannot actually be used; it is merely a sentinel that gets special treatment during Data Connect serialization
```
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2026

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@dconeybe dconeybe marked this pull request as ready for review March 4, 2026 17:01
@dconeybe dconeybe merged commit 0f67e32 into main Mar 4, 2026
61 of 65 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/AnyValueNullableListElementFix branch March 4, 2026 17:19
@firebase firebase locked and limited conversation to collaborators Apr 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants