Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

[FirebaseObject] Error message is never reset #390

Closed
@kptdobe

Description

@kptdobe

While exploring the "patch" requests (see #321), I realised you cannot test if some properties are present in the FirebaseObject / event. Consider this code:

FirebaseObject event = Firebase.readEvent();

String v = event.getString('nonexistingproperty'); // v = ""
println(event.error()); // prints "failed to convert to string"

v = event.getString('existingproperty'); // v = "value of existingproperty"
println(event.error()); // still prints "failed to convert to string"

The main issue here is that you can only test once if a property exists or not using FirebaseObject#failed() or FirebaseObject#success(): once the error message is set in the FirebaseObject, it is never reset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions