Skip to content

Commit

Permalink
Merge commit 'ccb045b68c5b4d983a90fa125513fc476e4e2387'
Browse files Browse the repository at this point in the history
* commit 'ccb045b68c5b4d983a90fa125513fc476e4e2387':
  fix: upgrade @graphql-tools/links from 6.2.4 to 6.2.5 (parse-community#7007)
  fix: upgrade pg-promise from 10.7.0 to 10.7.1 (parse-community#7009)
  fix: upgrade jwks-rsa from 1.10.1 to 1.11.0 (parse-community#7008)
  fix: upgrade graphql from 15.3.0 to 15.4.0 (parse-community#7011)
  update stale bot (parse-community#6998)
  fix(beforeSave/afterSave): Return value instead of Parse.Op for nested fields (parse-community#7005)
  fix(beforeSave): Skip Sanitizing Database results (parse-community#7003)
  Fix includeAll for querying a Pointer and Pointer array (parse-community#7002)
  Init (parse-community#6999)
  • Loading branch information
mtrezza committed Nov 19, 2020
2 parents dbf04f3 + ccb045b commit dc9f90d
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 115 deletions.
28 changes: 9 additions & 19 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 45
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- enhancement
- feature request
- good first issue
- hacktoberfest
- help wanted
- needs investigation
- needs more info
- question
- pinned
- security
- up-for-grabs
daysUntilClose: 30
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels:
- ":rocket: feature"
- ":dna: enhancement"
# Label to use when marking an issue as stale
staleLabel: stale
staleLabel: up-for-grabs
# Limit to only `issues` not `pulls`
only: issues
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
This issue has been automatically marked as up-for-grabs because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
closeComment: false
125 changes: 43 additions & 82 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"license": "BSD-3-Clause",
"dependencies": {
"@apollographql/graphql-playground-html": "1.6.26",
"@graphql-tools/links": "6.2.4",
"@graphql-tools/links": "6.2.5",
"@graphql-tools/stitch": "6.2.4",
"@graphql-tools/utils": "6.2.4",
"@parse/fs-files-adapter": "1.2.0",
Expand All @@ -35,20 +35,20 @@
"deepcopy": "2.1.0",
"express": "4.17.1",
"follow-redirects": "1.13.0",
"graphql": "15.3.0",
"graphql": "15.4.0",
"graphql-list-fields": "2.0.2",
"graphql-relay": "0.6.0",
"graphql-upload": "11.0.0",
"intersect": "1.0.1",
"jsonwebtoken": "8.5.1",
"jwks-rsa": "1.10.1",
"jwks-rsa": "1.11.0",
"ldapjs": "2.2.0",
"lodash": "4.17.20",
"lru-cache": "5.1.1",
"mime": "2.4.6",
"mongodb": "3.6.2",
"parse": "2.17.0",
"pg-promise": "10.7.0",
"pg-promise": "10.7.1",
"pluralize": "8.0.0",
"redis": "3.0.2",
"semver": "7.3.2",
Expand Down
39 changes: 39 additions & 0 deletions spec/CloudCode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,45 @@ describe('Cloud Code', () => {
});
});

it('beforeSave should not sanitize database', async done => {
const { adapter } = Config.get(Parse.applicationId).database;
const spy = spyOn(adapter, 'findOneAndUpdate').and.callThrough();
spy.calls.saveArgumentsByValue();

let count = 0;
Parse.Cloud.beforeSave('CloudIncrementNested', req => {
count += 1;
req.object.set('foo', 'baz');
expect(typeof req.object.get('objectField').number).toBe('number');
});

Parse.Cloud.afterSave('CloudIncrementNested', req => {
expect(typeof req.object.get('objectField').number).toBe('number');
});

const obj = new Parse.Object('CloudIncrementNested');
obj.set('objectField', { number: 5 });
obj.set('foo', 'bar');
await obj.save();

obj.increment('objectField.number', 10);
await obj.save();

const [
,
,
,
/* className */ /* schema */ /* query */ update,
] = adapter.findOneAndUpdate.calls.first().args;
expect(update).toEqual({
'objectField.number': { __op: 'Increment', amount: 10 },
foo: 'baz',
updatedAt: obj.updatedAt.toISOString(),
});

count === 2 ? done() : fail();
});

/**
* Verifies that an afterSave hook throwing an exception
* will not prevent a successful save response from being returned
Expand Down
Loading

0 comments on commit dc9f90d

Please sign in to comment.