Skip to content

Commit

Permalink
fix: Set encodeParseObjectInCloudFunction to true (#112)
Browse files Browse the repository at this point in the history
* feat: Set encodeParseObjectInCloudFunction to true

* Update release.yml
  • Loading branch information
cbaker6 authored Jan 20, 2025
1 parent a4e6263 commit 86a632c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tags: [ '*.*.*', '*.*.*-*' ]

env:
LATEST: '7.4.0'
LATEST: '7.4.1'
REGISTRY: docker.io
IMAGE_NAME: ${{ github.repository }}

Expand Down
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@
"description": "Enables database real-time hooks to update single schema cache. Set to `true` if using multiple Parse Servers instances connected to the same database. Failing to do so will cause a schema change to not propagate to all instances and re-syncing will only happen when the instances restart.",
"value": "true"
},
"PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION": {
"description": "If set to `true`, a `Parse.Object` that is in the payload when calling a Cloud Function will be converted to an instance of `Parse.Object`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Object` but is not an actual instance of `Parse.Object`. Default is `false`. The expected behavior would be that the object is converted to an instance of `Parse.Object`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where JavaScript objects are not converted to actual instances of `Parse.Object`.",
"value": "true"
},
"PARSE_SERVER_DIRECT_ACCESS": {
"description": "WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres.",
"value": "false"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION: 'false' # Don't allow classes to be created on the client side. You can create classes by using ParseDashboard instead
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'true' # If you are not using ParseCareKit, set this to 'false'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.mongo.dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION: 'false' # Don't allow classes to be created on the client side. You can create classes by using ParseDashboard instead
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'true' # If you are not using ParseCareKit, set this to 'false'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION: 'false' # Don't allow classes to be created on the client side. You can create classes by using ParseDashboard instead
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'true' # If you are not using ParseCareKit, set this to 'false'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.no.hipaa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION: 'false' # Don't allow classes to be created on the client side. You can create classes by using ParseDashboard instead
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'false' # If you are not using ParseCareKit, set this to 'false'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION: 'false' # Don't allow classes to be created on the client side. You can create classes by using ParseDashboard instead
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'true' # If you are not using ParseCareKit, set this to 'false'
Expand Down
18 changes: 12 additions & 6 deletions parse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const cors = require('cors');
const FSFilesAdapter = require('@parse/fs-files-adapter');

const mountPath = process.env.PARSE_SERVER_MOUNT_PATH || '/parse';
const graphMountPath = process.env.PARSE_SERVER_GRAPHQL_PATH || '/graphql';
const graphQLPath = process.env.PARSE_SERVER_GRAPHQL_PATH || '/graphql';
const dashboardMountPath = process.env.PARSE_DASHBOARD_MOUNT_PATH || '/dashboard';
const applicationId = process.env.PARSE_SERVER_APPLICATION_ID || 'myAppId';
const primaryKey = process.env.PARSE_SERVER_PRIMARY_KEY || 'myKey';
Expand All @@ -30,7 +30,7 @@ if ("NEW_RELIC_APP_NAME" in process.env) {
const publicServerURL = process.env.PARSE_SERVER_PUBLIC_URL || serverURL;
const url = new URL(publicServerURL);
const graphURL = new URL(publicServerURL);
graphURL.pathname = graphMountPath;
graphURL.pathname = graphQLPath;
const dashboardURL = new URL(publicServerURL);
dashboardURL.pathname = dashboardMountPath;

Expand Down Expand Up @@ -109,6 +109,11 @@ if (process.env.PARSE_SERVER_DATABASE_ENABLE_SCHEMA_HOOKS == 'true') {
enableSchemaHooks = true
}

let encodeParseObjectInCloudFunction = false;
if (process.env.PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION == 'true') {
encodeParseObjectInCloudFunction = true
}

let useDirectAccess = false;
if (process.env.PARSE_SERVER_DIRECT_ACCESS == 'true') {
useDirectAccess = true
Expand Down Expand Up @@ -257,6 +262,9 @@ if (Object.keys(filesAdapter).length === 0) {

configuration = {
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
databaseOptions: {
enableSchemaHooks: enableSchemaHooks,
},
cloud: process.env.PARSE_SERVER_CLOUD || __dirname + '/cloud/main.js',
appId: applicationId,
masterKey: primaryKey,
Expand Down Expand Up @@ -285,7 +293,7 @@ configuration = {
fileExtensions: fileExtensions,
},
maxUploadSize: fileMaxUploadSize,
enableSchemaHooks: enableSchemaHooks,
encodeParseObjectInCloudFunction: encodeParseObjectInCloudFunction,
directAccess: useDirectAccess,
allowExpiredAuthDataToken: allowExpiredAuthDataToken,
enforcePrivateUsers: enforcePrivateUsers,
Expand All @@ -300,11 +308,9 @@ configuration = {
startLiveQueryServer: startLiveQueryServer,
liveQuery: {
classNames: classNames, // List of classes to support for query subscriptions
websocketTimeout: websocketTimeout,
cacheTimeout: cacheTimeout
},
mountGraphQL: enableGraphQL,
graphMountPath: graphMountPath,
graphQLPath: graphQLPath,
mountPlayground: mountPlayground,
playgroundPath: playgroundPath,
verifyUserEmails: verifyUserEmails,
Expand Down

0 comments on commit 86a632c

Please sign in to comment.