parse-community / parse-community/parse-server

beforeSubscribe, onLiveQueryEvent and afterLiveQueryEvent hooks are not called (LiveQuery)

Open
#9,088 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

With Live Query configured and running, the Parse.Cloud.beforeSubscribe, Parse.Cloud.onLiveQueryEvent and Parse.Cloud.afterLiveQueryEvent hooks in cloud code are never called.
The Parse.LiveQuery.on and Parse.Cloud.beforeConnect hooks receive events, as well as the Android app subscribing to a query.

Steps to reproduce
liveQuery: {
    classNames: ['Message'],
    redisURL: 'redis://localhost:6379'
}
const app = express();
let httpServer = require('http').createServer(app);
httpServer.listen(port);
const parseLiveQueryServer = ParseServer.createLiveQueryServer(httpServer, {redisURL: ...});

and subscribing to a query in e.g. Android:

ParseQuery<ParseObject> parseQuery = new ParseQuery<>("Message");
SubscriptionHandling<ParseObject> subscriptionHandling = liveQueryClient.subscribe(parseQuery);
Actual Outcome

The Android app receives all events (create, update, delete, etc.) but the cloud code hooks (e.g. afterLiveQueryEvent) never run.

Expected Outcome

The hooks are called.

Environment

Server

  • Parse Server version: 7.0.0
  • Operating system: Ubuntu server
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): VPS

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Android
  • SDK version: 4.3.0
Logs

The live query server starts and logs Create new client: ... when the Android app connects/disconnects, but no other logs show up from the cloud code/Parse.
Tested with and without redis.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at ParseServer.createLiveQueryServer and the Parse.Cloud.beforeSubscribe, onLiveQueryEvent, and afterLiveQueryEvent hook entry points. Reproduce with the shown Live Query and Redis configuration and an Android subscription, then trace why the hooks receive no events. Done means each expected hook is called for the corresponding Live Query activity.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript, nodejs
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.