MCPcopy Index your code
hub / github.com/parse-community/parse-server / createSubscribedClient

Function createSubscribedClient

spec/vulnerabilities.spec.js:3677–3695  ·  view source on GitHub ↗
({ className, masterKey, installationId })

Source from the content-addressed store, hash-verified

3675 describe('(GHSA-m983-v2ff-wq65) LiveQuery shared mutable state race across concurrent subscribers', () => {
3676 // Helper: create a LiveQuery client, wait for open, subscribe, wait for subscription ACK
3677 async function createSubscribedClient({ className, masterKey, installationId }) {
3678 const opts = {
3679 applicationId: 'test',
3680 serverURL: 'ws://localhost:8378',
3681 javascriptKey: 'test',
3682 };
3683 if (masterKey) {
3684 opts.masterKey = 'test';
3685 }
3686 if (installationId) {
3687 opts.installationId = installationId;
3688 }
3689 const client = new Parse.LiveQueryClient(opts);
3690 client.open();
3691 const query = new Parse.Query(className);
3692 const sub = client.subscribe(query);
3693 await new Promise(resolve => sub.on('open', resolve));
3694 return { client, sub };
3695 }
3696
3697 async function setupProtectedClass(className) {
3698 const config = Config.get(Parse.applicationId);

Callers 1

Calls 1

subscribeMethod · 0.65

Tested by

no test coverage detected