Skip to content

fix(app): handle empty Android Firebase JSON - #9259

Open
OskarEichler wants to merge 1 commit into
invertase:mainfrom
OskarEichler:codex/app-empty-firebase-json
Open

fix(app): handle empty Android Firebase JSON#9259
OskarEichler wants to merge 1 commit into
invertase:mainfrom
OskarEichler:codex/app-empty-firebase-json

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Compatibility

  • No public API or type changes.
  • No breaking changes.
  • Observable correction: jsonGetAll now returns an empty map when no firebase.json React Native settings exist instead of crashing on Android.

What changed

  • Iterate JSONObject keys directly, which handles an empty object and avoids allocating a JSONArray of key names.
  • Return the already-created empty bridge map if parsing was unavailable.
  • Add a focused Robolectric regression for the default empty-object configuration.

Verification

  • Exact regression fails on upstream main with NullPointerException and passes with this change.
  • Full App Android unit suite passes.
  • App Android debug AAR assembly and lint pass.
  • Repository Android formatting and whitespace checks pass.

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good but needs to drop the robolectric pin using some work I've got in-flight elsewhere - queueing this for a quick edit after that lands, to rebase the other work in and remove the pin

import org.robolectric.annotation.Config;

@RunWith(RobolectricTestRunner.class)
@Config(sdk = 34)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got a PR in flight that drops this - the sdk = 34 robolectric pin is idiomatic in the codebase but is unnecessary and will result in unnecessary robolectric implementation jars in the future

@mikehardy mikehardy added blocked: do-not-merge Do not merge this issue without approval by the person who labelled this issue as Do Not Merge Workflow: Needs Review Pending feedback or review from a maintainer. labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked: do-not-merge Do not merge this issue without approval by the person who labelled this issue as Do Not Merge Workflow: Needs Review Pending feedback or review from a maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants