Skip to content

Commit 0cb352e

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: (63 commits) Fixes parse-community#1649 (parse-community#1650) Update issue template (parse-community#1899) Break schemaController dependency. (parse-community#1901) Remove unnecessary null check Update schema mismatch error to include type string (parse-community#1898) Move more mongo specific stuff into mongo adapter Kill mongoOptions Consistent parameter order move transformWhere into mongo adapter Remove options from count Can't sort a count Remove limit from count Destructure mongo options remove adaptive collection call create + use adapter count instead of collection count transformWhere in MongoAdapter remove schemaController paramater Remove schemaController parameter Remove getRelationFields Remove all dependencies on schemaController ...
2 parents 209317f + 0850c18 commit 0cb352e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2241
-1191
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
Check out https://github.com/ParsePlatform/parse-server/issues/1271 for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!
1+
Please read the following instructions carefully.
22

3-
Many members of the community use Stack Overflow and Server Fault to ask questions. Read through the existing questions or ask your own!
3+
Check out https://github.com/ParsePlatform/parse-server/issues/1271 for an ideal bug report.
4+
The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!
45

6+
Many members of the community use Stack Overflow and Server Fault to ask questions.
7+
Read through the existing questions or ask your own!
58
- Stack Overflow: http://stackoverflow.com/questions/tagged/parse.com
69
- Server Fault: https://serverfault.com/tags/parse
710

@@ -15,16 +18,50 @@ Make sure these boxes are checked before submitting your issue -- thanks for rep
1518

1619
- [ ] You've searched through existing issues: https://github.com/ParsePlatform/Parse-Server/issues?utf8=%E2%9C%93&q=is%3Aissue Chances are that your issue has been reported or resolved before.
1720

18-
#### Environment Setup
21+
- [ ] You have filled out every section below. Issues without sufficient information are more likely to be closed.
1922

20-
- Server: parse-server version, operating system, hardware, local or remote?
21-
- Database: version, storage engine, hardware, local or remote?
23+
--
2224

23-
#### Steps to reproduce
25+
### Issue Description
2426

25-
- Can this issue be reproduced using the Parse Server REST API? Include curl commands when applicable.
26-
- What was the expected result? What is the actual outcome?
27+
[DELETE EVERYTHING ABOVE THIS LINE BEFORE SUBMITTING YOUR ISSUE]
2728

28-
#### Logs/Trace
29+
Describe your issue in as much detail as possible.
2930

30-
- You can turn on additional logging by configuring VERBOSE=1 in your environment.
31+
[FILL THIS OUT]
32+
33+
### Steps to reproduce
34+
35+
Please include a detailed list of steps that reproduce the issue. Include curl commands when applicable.
36+
37+
1. [FILL THIS OUT]
38+
2. [FILL THIS OUT]
39+
3. [FILL THIS OUT]
40+
41+
#### Expected Results
42+
43+
[FILL THIS OUT]
44+
45+
#### Actual Outcome
46+
47+
[FILL THIS OUT]
48+
49+
### Environment Setup
50+
51+
- **Server**
52+
- parse-server version: [FILL THIS OUT]
53+
- Operating System: [FILL THIS OUT]
54+
- Hardware: [FILL THIS OUT]
55+
- Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [FILL THIS OUT]
56+
57+
- **Database**
58+
- MongoDB version: [FILL THIS OUT]
59+
- Storage engine: [FILL THIS OUT]
60+
- Hardware: [FILL THIS OUT]
61+
- Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): [FILL THIS OUT]
62+
63+
### Logs/Trace
64+
65+
You can turn on additional logging by configuring VERBOSE=1 in your environment.
66+
67+
[FILL THIS OUT]

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
matrix:
99
- MONGODB_VERSION=2.6.11
1010
- MONGODB_VERSION=3.0.8
11+
- MONGODB_VERSION=3.2.6
1112
branches:
1213
only:
1314
- master

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## Parse Server Changelog
22

3+
### 2.2.10 (5/15/2016)
4+
5+
* Fix: Write legacy ACLs to Mongo so that clients that still go through Parse.com can read them, thanks to [Tyler Brock](https://github.com/TylerBrock) and [carmenlau](https://github.com/carmenlau)
6+
* Fix: Querying installations with limit = 0 and count = 1 now works, thanks to [ssk7833](https://github.com/ssk7833)
7+
* Fix: Return correct error when violating unique index, thanks to [Marco Cheung](https://github.com/Marco129)
8+
* Fix: Allow unsetting user's email, thanks to [Marco Cheung](https://github.com/Marco129)
9+
* New: Support for Node 6.1
10+
311
### 2.2.9 (5/9/2016)
412

513
* Fix: Fix a regression that caused Parse Server to crash when a null parameter is passed to a Cloud function

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ That's it! You are now running a standalone version of Parse Server on your mach
2828

2929
**Using a remote MongoDB?** Pass the `--databaseURI DATABASE_URI` parameter when starting `parse-server`. Learn more about configuring Parse Server [here](#configuration). For a full list of available options, run `parse-server --help`.
3030

31+
**Want logs to be in placed in other folder?** Pass the `PARSE_SERVER_LOGS_FOLDER` environment variable when starting `parse-server`. Usage :- `PARSE_SERVER_LOGS_FOLDER='<path-to-logs-folder>' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
32+
3133
### Saving your first object
3234

3335
Now that you're running Parse Server, it is time to save your first object. We'll use the [REST API](https://parse.com/docs/rest/guide), but you can easily do the same using any of the [Parse SDKs](https://parseplatform.github.io/#sdks). Run the following:
@@ -243,6 +245,9 @@ $ PORT=8080 parse-server --appId APPLICATION_ID --masterKey MASTER_KEY
243245

244246
For the full list of configurable environment variables, run `parse-server --help`.
245247

248+
### Available Adapters
249+
[Parse Server Modules (Adapters)](https://github.com/parse-server-modules)
250+
246251
### Configuring File Adapters
247252

248253
Parse Server allows developers to choose from several options when hosting files:

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "2.2.9",
3+
"version": "2.2.10",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -31,7 +31,7 @@
3131
"lru-cache": "^4.0.0",
3232
"mailgun-js": "^0.7.7",
3333
"mime": "^1.3.4",
34-
"mongodb": "~2.1.0",
34+
"mongodb": "2.1.18",
3535
"multer": "^1.1.0",
3636
"parse": "^1.8.0",
3737
"parse-server-fs-adapter": "^1.0.0",
@@ -59,13 +59,13 @@
5959
"deep-diff": "^0.3.3",
6060
"gaze": "^1.0.0",
6161
"jasmine": "^2.3.2",
62-
"mongodb-runner": "3.2.2",
62+
"mongodb-runner": "^3.3.2",
6363
"nodemon": "^1.8.1"
6464
},
6565
"scripts": {
6666
"dev": "npm run build && node bin/dev",
6767
"build": "./node_modules/.bin/babel src/ -d lib/",
68-
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.0.8} ./node_modules/.bin/mongodb-runner start",
68+
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 ./node_modules/.bin/mongodb-runner start",
6969
"test": "cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js",
7070
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node ./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/** ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
7171
"posttest": "./node_modules/.bin/mongodb-runner stop",

spec/CacheController.spec.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
var CacheController = require('../src/Controllers/CacheController.js').default;
2+
3+
describe('CacheController', function() {
4+
var FakeCacheAdapter;
5+
var FakeAppID = 'foo';
6+
var KEY = 'hello';
7+
8+
beforeEach(() => {
9+
FakeCacheAdapter = {
10+
get: () => Promise.resolve(null),
11+
put: jasmine.createSpy('put'),
12+
del: jasmine.createSpy('del'),
13+
clear: jasmine.createSpy('clear')
14+
}
15+
16+
spyOn(FakeCacheAdapter, 'get').and.callThrough();
17+
});
18+
19+
20+
it('should expose role and user caches', (done) => {
21+
var cache = new CacheController(FakeCacheAdapter, FakeAppID);
22+
23+
expect(cache.role).not.toEqual(null);
24+
expect(cache.role.get).not.toEqual(null);
25+
expect(cache.user).not.toEqual(null);
26+
expect(cache.user.get).not.toEqual(null);
27+
28+
done();
29+
});
30+
31+
32+
['role', 'user'].forEach((cacheName) => {
33+
it('should prefix ' + cacheName + ' cache', () => {
34+
var cache = new CacheController(FakeCacheAdapter, FakeAppID)[cacheName];
35+
36+
cache.put(KEY, 'world');
37+
var firstPut = FakeCacheAdapter.put.calls.first();
38+
expect(firstPut.args[0]).toEqual([FakeAppID, cacheName, KEY].join(':'));
39+
40+
cache.get(KEY);
41+
var firstGet = FakeCacheAdapter.get.calls.first();
42+
expect(firstGet.args[0]).toEqual([FakeAppID, cacheName, KEY].join(':'));
43+
44+
cache.del(KEY);
45+
var firstDel = FakeCacheAdapter.del.calls.first();
46+
expect(firstDel.args[0]).toEqual([FakeAppID, cacheName, KEY].join(':'));
47+
});
48+
});
49+
50+
it('should clear the entire cache', () => {
51+
var cache = new CacheController(FakeCacheAdapter, FakeAppID);
52+
53+
cache.clear();
54+
expect(FakeCacheAdapter.clear.calls.count()).toEqual(1);
55+
56+
cache.user.clear();
57+
expect(FakeCacheAdapter.clear.calls.count()).toEqual(2);
58+
59+
cache.role.clear();
60+
expect(FakeCacheAdapter.clear.calls.count()).toEqual(3);
61+
});
62+
63+
it('should handle cache rejections', (done) => {
64+
65+
FakeCacheAdapter.get = () => Promise.reject();
66+
67+
var cache = new CacheController(FakeCacheAdapter, FakeAppID);
68+
69+
cache.get('foo').then(done, () => {
70+
fail('Promise should not be rejected.');
71+
});
72+
});
73+
74+
});

0 commit comments

Comments
 (0)