Skip to content

Update uuid to the latest version 🚀 #6659

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

Merged
4 commits merged into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"semver": "7.3.2",
"subscriptions-transport-ws": "0.9.16",
"tv4": "1.3.0",
"uuid": "3.4.0",
"uuid": "8.0.0",
"winston": "3.2.1",
"winston-daily-rotate-file": "4.4.2",
"ws": "7.2.5"
Expand Down Expand Up @@ -122,7 +122,9 @@
"url": "https://opencollective.com/parse-server",
"logo": "https://opencollective.com/parse-server/logo.txt?reverse=true&variant=binary"
},
"publishConfig": { "registry": "https://npm.pkg.github.com/" },
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parse-server"
Expand Down
2 changes: 1 addition & 1 deletion spec/ParseGraphQLServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const {
const { ParseServer } = require('../');
const { ParseGraphQLServer } = require('../lib/GraphQL/ParseGraphQLServer');
const ReadPreference = require('mongodb').ReadPreference;
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');

function handleError(e) {
if (
Expand Down
20 changes: 10 additions & 10 deletions src/LiveQuery/ParseLiveQueryServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { matchesQuery, queryHash } from './QueryTools';
import { ParsePubSub } from './ParsePubSub';
import SchemaController from '../Controllers/SchemaController';
import _ from 'lodash';
import uuid from 'uuid';
import { v4 as uuidv4 } from 'uuid';
import { runLiveQueryEventHandlers } from '../triggers';
import { getAuthForSessionToken, Auth } from '../Auth';
import { getCacheController } from '../Controllers';
Expand Down Expand Up @@ -60,7 +60,7 @@ class ParseLiveQueryServer {
// Initialize websocket server
this.parseWebSocketServer = new ParseWebSocketServer(
server,
parseWebsocket => this._onConnect(parseWebsocket),
(parseWebsocket) => this._onConnect(parseWebsocket),
config
);

Expand Down Expand Up @@ -165,13 +165,13 @@ class ParseLiveQueryServer {
// Check ACL
return this._matchesACL(acl, client, requestId);
})
.then(isMatched => {
.then((isMatched) => {
if (!isMatched) {
return null;
}
client.pushDelete(requestId, deletedParseObject);
})
.catch(error => {
.catch((error) => {
logger.error('Matching ACL error : ', error);
});
}
Expand Down Expand Up @@ -298,7 +298,7 @@ class ParseLiveQueryServer {
originalParseObject
);
},
error => {
(error) => {
logger.error('Matching ACL error : ', error);
}
);
Expand All @@ -308,7 +308,7 @@ class ParseLiveQueryServer {
}

_onConnect(parseWebsocket: any): void {
parseWebsocket.on('message', request => {
parseWebsocket.on('message', (request) => {
if (typeof request === 'string') {
try {
request = JSON.parse(request);
Expand Down Expand Up @@ -426,10 +426,10 @@ class ParseLiveQueryServer {
cacheController: this.cacheController,
sessionToken: sessionToken,
})
.then(auth => {
.then((auth) => {
return { auth, userId: auth && auth.user && auth.user.id };
})
.catch(error => {
.catch((error) => {
// There was an error with the session token
const result = {};
if (error && error.code === Parse.Error.INVALID_SESSION_TOKEN) {
Expand Down Expand Up @@ -523,7 +523,7 @@ class ParseLiveQueryServer {
return Promise.resolve()
.then(async () => {
// Resolve false right away if the acl doesn't have any roles
const acl_has_roles = Object.keys(acl.permissionsById).some(key =>
const acl_has_roles = Object.keys(acl.permissionsById).some((key) =>
key.startsWith('role:')
);
if (!acl_has_roles) {
Expand Down Expand Up @@ -581,7 +581,7 @@ class ParseLiveQueryServer {
return;
}
const hasMasterKey = this._hasMasterKey(request, this.keyPairs);
const clientId = uuid();
const clientId = uuidv4();
const client = new Client(
clientId,
parseWebsocket,
Expand Down