Skip to content
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

Unique indexes #1971

Merged
merged 32 commits into from
Jun 11, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
49df78f
Add unique indexing
drew-gross May 27, 2016
4c84650
Add unique indexing for username/email
drew-gross May 28, 2016
6584e62
WIP
drew-gross May 31, 2016
aa1c51b
Finish unique indexes
drew-gross Jun 1, 2016
895eaf1
Notes on how to upgrade to 2.3.0 safely
drew-gross Jun 2, 2016
f0353e6
index on unique-indexes: c454180 Revert "Log objects rather than JSON…
drew-gross Jun 6, 2016
44f9ee5
reconfigure username/email tests
drew-gross Jun 6, 2016
1e557e8
Start dealing with test shittyness
drew-gross Jun 7, 2016
d346b29
Remove tests for files that we are removing
drew-gross Jun 7, 2016
8fe737f
most tests passing
drew-gross Jun 7, 2016
3da4ce0
fix failing test
drew-gross Jun 7, 2016
0f2c723
Make specific server config for tests async
drew-gross Jun 7, 2016
74036ad
Fix more tests
drew-gross Jun 7, 2016
1bc15d2
fix more tests
drew-gross Jun 7, 2016
2f2f010
Fix another test
drew-gross Jun 7, 2016
8a3e52e
fix more tests
drew-gross Jun 7, 2016
c2c85f7
Fix email validation
drew-gross Jun 7, 2016
4c35ef2
move some stuff around
drew-gross Jun 8, 2016
b16d22c
Destroy server to ensure all connections are gone
drew-gross Jun 8, 2016
f827c73
Fix broken cloud code
drew-gross Jun 8, 2016
c290c35
Save callback to variable
drew-gross Jun 8, 2016
dccc1db
no need to delete non existant cloud
drew-gross Jun 8, 2016
05e5495
undo
drew-gross Jun 8, 2016
3e7a03e
Fix all tests where connections are left open after server closes.
drew-gross Jun 8, 2016
7e1349c
Fix issues caused by missing gridstore adapter
drew-gross Jun 8, 2016
0dc918a
Update guide for 2.3.0 and fix final tests
drew-gross Jun 8, 2016
a3f023b
use strict
drew-gross Jun 8, 2016
cbbc590
don't use features that won't work in node 4
drew-gross Jun 8, 2016
1a0859d
Fix syntax error
drew-gross Jun 8, 2016
0b0518f
Fix typos
drew-gross Jun 9, 2016
b88a0b2
Add duplicate finding command
drew-gross Jun 9, 2016
1b8aaaf
Update 2.3.0.md
drew-gross Jun 9, 2016
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
Prev Previous commit
Next Next commit
Fix issues caused by missing gridstore adapter
  • Loading branch information
drew-gross committed Jun 8, 2016
commit 7e1349ce31c1cfa6f9df322b9cf08438db9a42c5
10 changes: 8 additions & 2 deletions spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@ var ParseServer = require('../src/index').ParseServer;
var path = require('path');
var TestUtils = require('../src/index').TestUtils;
var MongoStorageAdapter = require('../src/Adapters/Storage/Mongo/MongoStorageAdapter');
const GridStoreAdapter = require('../src/Adapters/Files/GridStoreAdapter').GridStoreAdapter;


var port = 8378;

var mongoAdapter = new MongoStorageAdapter({
uri: 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase',
let mongoURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase';
let mongoAdapter = new MongoStorageAdapter({
uri: mongoURI,
collectionPrefix: 'test_',
})

let gridStoreAdapter = new GridStoreAdapter(mongoURI);

// Default server configuration for tests.
var defaultConfiguration = {
databaseAdapter: mongoAdapter,
filesAdapter: gridStoreAdapter,
serverURL: 'http://localhost:' + port + '/1',
appId: 'test',
javascriptKey: 'test',
Expand Down
4 changes: 4 additions & 0 deletions src/ParseServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ class ParseServer {
databaseAdapter = loadAdapter(databaseAdapter)
}

if (!filesAdapter && !databaseURI) {
throw 'When using an explicit database adapter, you must also use and explicit filesAdapter.';
}

if (logsFolder) {
configureLogger({
logsFolder
Expand Down
15 changes: 7 additions & 8 deletions src/Routers/FilesRouter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import express from 'express';
import BodyParser from 'body-parser';
import * as Middlewares from '../middlewares';
import express from 'express';
import BodyParser from 'body-parser';
import * as Middlewares from '../middlewares';
import { randomHexString } from '../cryptoUtils';
import Config from '../Config';
import mime from 'mime';
import Config from '../Config';
import mime from 'mime';

export class FilesRouter {

Expand Down Expand Up @@ -77,8 +77,7 @@ export class FilesRouter {
res.set('Location', result.url);
res.json(result);
}).catch((err) => {
next(new Parse.Error(Parse.Error.FILE_SAVE_ERROR,
'Could not store file.'));
next(new Parse.Error(Parse.Error.FILE_SAVE_ERROR, 'Could not store file.'));
});
}

Expand All @@ -93,4 +92,4 @@ export class FilesRouter {
'Could not delete file.'));
});
}
}
}