mikkopaderes / ember-cloud-firestore-adapter

Unofficial Ember Data Adapter and Serializer for Cloud Firestore
MIT License
69 stars 17 forks source link

Not able to find record with `query` #251

Closed knownasilya closed 2 years ago

knownasilya commented 2 years ago

I'm migrating from emberfire (beta)

Describe the bug

Querying like so:

const accounts = await this.dataStore.query('account', {
      isRealtime: true,
      queryId: 'account',
      filter: (ref: any) => {
        return query(
          ref,
          where('username', '==', username.toLowerCase()),
          limit(1)
        );
      },
    });
const account = accounts.objectAt(0);

Resulting account is undefined. This worked with similar syntax in emberfire. The records are simple in this case.

Console says this before the query not found:

@firebase/firestore: Firestore (9.13.0): Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=unavailable]: The operation could not be completed This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

Expected behavior Expecting an account returned.

Tooling versions (please complete the following information):

knownasilya commented 2 years ago

Ah, I had the emulator config. Might be worth having that commented out in the docs?

mikkopaderes commented 2 years ago

I have it in docs to disable it in production here

knownasilya commented 2 years ago

Hum, might not be worth showing in getting started?