Skip to content

feat(queries): warnings for invalid query config parameters #541

Open
@rdougan

Description

@rdougan

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

I'm using the following code in my app:

export default compose(
  connect(mapStateToProps),
  firebaseConnect(props => ({
    path: 'channels',
    queryParams: ['orderByChild=receiver', `equalTo= EAbx9f4RtNRjVBR1ABuTUxMBmps2`],
  })),
)(Incoming);

The view is populated, however an unhandled promise error appears after a second. Database: Client doesn't have permission to access the desired data.

The following code works:

firebase.database().ref('/channels')
  .orderByChild('receiver')
  .equalTo('EAbx9f4RtNRjVBR1ABuTUxMBmps2')
  .once('value', (snapshot) => {
    const channels = _.map(snapshot.val(), (val, uid) => { uid });
    console.log(channels.length);
  });

The rules are simple:

{
  "rules": {
    "channels": {
      ".read": "auth != null",
      ".write": "auth != null",
    },
  },
}

simulator screen shot - iphone xr - 2018-09-29 at 02 41 27

What is the expected behavior?

No unhandled promise warning should appear.

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?

2.1.8

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions