Skip to content
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

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

Open
hej2010 opened this issue Apr 16, 2024 · 1 comment
Labels
bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@hej2010
Copy link
Contributor

hej2010 commented Apr 16, 2024

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.

Copy link

parse-github-assistant bot commented Apr 16, 2024

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants