I have been trying to create a live query on a Parse server using a subscription, but it seems like some events are not triggered.
I log every event that the subscription receives, and I know that 'open' is triggered. However, I do not receive any other events when I change data that should influence the query result. I enabled live query classes on the backend for CanvasVersion and Sticky on a Sashido Parse server.
This is the client code:
const relation = this.canvasVersion.stickies;
const query = relation.query();
query.equalTo("segment", this.id);
this.segmentUpdatedSubscription = await query.subscribe();
this.segmentUpdatedSubscription.on('open', () => {
console.log('Subscription opened');
})
this.segmentUpdatedSubscription.on('error', (error) => {
console.log('error', error);
})
this.segmentUpdatedSubscription.on('create', (sticky) => {
console.log('Created: ' + sticky);
});
Continuing for 'update', 'enter', 'delete', 'leave' and 'close', where this.canvasVersion.stickies is a relation between the canvasVersion and Sticky objects.
The parse server is initialized with the following code:
static initialize() {
Parse.initialize(environment.parse.appId, environment.parse.appKey);
(Parse as any).serverURL = environment.parse.serverURL;
}
Does someone know why these events are not triggered and how I can solve it? Thanks in advance for the help.