-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Realtime Updates not working #605
Comments
I second this, I am in a process of migrating a project from emberfire 2 to 3. I have migrated hasMany relationships and rewrote authentication code, the app displays data fine. But realtime updates seem broken... |
It seems that it comes down to the class names of the adapter and the serializer. I changed from // adapters/application
import FirestoreAdapter from 'emberfire/adapters/firestore';
export default class ApplicationAdapter extends FirestoreAdapter {
// ...
} to // adapters/application
import FirestoreAdapterBase from 'emberfire/adapters/firestore';
export default class FirestoreAdapter extends FirestoreAdapterBase {
// ...
} And I added this serializer, because there was a crash otherwise when creating records: // serializers/application
import FirestoreSerializerBase from 'emberfire/serializers/firestore';
export default class FirestoreSerializer extends FirestoreSerializerBase {
normalizeCreateRecordResponse(store, primaryModelClass) {
let result = super.normalizeCreateRecordResponse(...arguments)
result.data.type = primaryModelClass.modelName
return result
}
} The class name With these changes, everything seems to work as expected. Does it help at all? |
@Mitchal yes you are right. the realtime listener just reacts to the |
So it seems the realtime updates stop working when building the Ember app for production. I guess it might be because the constructor name is then uglified and this code will stop working again. Not really sure how to solve it though, does anyone have any ideas? EDIT: FOUND IT! :-D let app = new EmberApp(defaults, {
'ember-cli-uglify': {
uglify: {
mangle: {
reserved: ['FirestoreSerializer', 'FirestoreAdapter']
}
}
},
}); Hopefully no more hacks will be required. 🤔 |
@Mitchal ... Can you post the solution for Realtime Database, please? |
Unfortunately not, I haven't been working with the realtime DB for years and really I don't know much about this lib either (other than that it is AWESOME when it works). I was just lucky to figure out that one very particular problem. 🤷♂️ Maybe the repo maintainers can help you. I hope you manage to solve it, cause I know how frustrating these problems can be! |
FINALLY got it to work with the following ... and many thanks to you guys! So the following is to make Realtime Database realtime updates work with (in my case):
|
Is the
RealtimeRouteMixin
working in RC6? I added the Firestore config and a basic layout. I get all data bythis.store.findAll('article')
. The current state is loaded and displayed correctly. But when I change something in the Firebase console the data is not updated in the Ember client. with version 2.x and the RTDB this was working.Is this intended or a bug?
Version info
Test case
https://github.com/maximilianmeier/emberfire-dev/tree/fd79dce49ed3d610201e6c5b338b60931a6e2f65
Steps to reproduce
Expected behavior
The Data should update without a manual reload.
Actual behavior
The Data does currently not update without a manual reload.
The text was updated successfully, but these errors were encountered: