diff --git a/api/migrations/20190501021006-remove-all-private-channel-members.js b/api/migrations/20190501021006-remove-all-private-channel-members.js deleted file mode 100644 index 36766c1aa7..0000000000 --- a/api/migrations/20190501021006-remove-all-private-channel-members.js +++ /dev/null @@ -1,75 +0,0 @@ -exports.up = async function(r, conn) { - // get all private channels that haven't been deleted - const privateChannels = await r - .db('spectrum') - .table('channels') - .filter({ isPrivate: true }) - .filter(row => row.hasFields('deletedAt').not()) - .run(conn) - .then(cursor => cursor.toArray()); - - // for each channel, remove all members except the community owner - return Promise.all( - privateChannels.map(async channel => { - const community = await r - .db('spectrum') - .table('communities') - .get(channel.communityId) - .run(conn); - - // ensure that the community owner also owns the channel - // to account for situations where a moderator created the channel - const communityOwnerChannelRecord = await r - .db('spectrum') - .table('usersChannels') - .getAll([community.creatorId, channel.id], { - index: 'userIdAndChannelId', - }) - .run(conn) - .then(cursor => cursor.toArray()); - - if ( - !communityOwnerChannelRecord || - communityOwnerChannelRecord.length === 0 - ) { - await r - .db('spectrum') - .table('usersChannels') - .insert({ - channelId: channel.id, - userId: community.creatorId, - createdAt: new Date(), - isOwner: true, - isMember: true, - isModerator: false, - isBlocked: false, - isPending: false, - receiveNotifications: false, - }) - .run(conn); - } else { - await r - .db('spectrum') - .table('usersChannels') - .getAll([community.creatorId, channel.id], { - index: 'userIdAndChannelId', - }) - .update({ isOwner: true }) - .run(conn); - } - - return await r - .db('spectrum') - .table('usersChannels') - .getAll(channel.id, { index: 'channelId' }) - .filter({ isMember: true }) - .filter(row => row('userId').ne(community.creatorId)) - .update({ isMember: false }) - .run(conn); - }) - ); -}; - -exports.down = function(r, conn) { - return Promise.resolve(); -}; diff --git a/api/models/usersChannels.js b/api/models/usersChannels.js index ff7b4ed786..02fe489c48 100644 --- a/api/models/usersChannels.js +++ b/api/models/usersChannels.js @@ -452,7 +452,7 @@ const createMemberInDefaultChannels = (communityId: string, userId: string): Pro }; // prettier-ignore -const toggleUserChannelNotifications = async (userId: string, channelId: string, value: boolean): Promise => { +const toggleUserChannelNotifications = async (userId: string, channelId: string, value: boolean): Promise => { const event = value ? events.CHANNEL_NOTIFICATIONS_ENABLED : events.CHANNEL_NOTIFICATIONS_DISABLED trackQueue.add({ @@ -490,7 +490,7 @@ const toggleUserChannelNotifications = async (userId: string, channelId: string, return createMemberInChannel(channelId, userId, false) } - return + return null }; const removeUsersChannelMemberships = async (userId: string) => { diff --git a/now.json b/now.json index 25e168fe97..ccbb205144 100644 --- a/now.json +++ b/now.json @@ -9,11 +9,11 @@ "DEBUG": "shared:rethinkdb:db-query-cache", "S3_TOKEN": "@s3-token", "S3_SECRET": "@s3-secret", - "COMPOSE_RETHINKDB_PASSWORD": "@github-compose-rethinkdb-password", - "COMPOSE_RETHINKDB_URL": "@github-compose-rethinkdb-url", - "COMPOSE_RETHINKDB_PORT": "@github-compose-rethinkdb-port", - "BACKUP_RETHINKDB_URL": "@backup-compose-rethinkdb-url", - "BACKUP_RETHINKDB_PORT": "@backup-compose-rethinkdb-port", + "COMPOSE_RETHINKDB_PASSWORD": "@new-compose-rethinkdb-password", + "COMPOSE_RETHINKDB_URL": "@new-compose-rethinkdb-url", + "COMPOSE_RETHINKDB_PORT": "@new-compose-rethinkdb-port", + "BACKUP_RETHINKDB_URL": "@new-backup-compose-rethinkdb-url", + "BACKUP_RETHINKDB_PORT": "@new-backup-compose-rethinkdb-port", "AWS_RETHINKDB_PASSWORD": "@aws-rethinkdb-password", "AWS_RETHINKDB_URL": "@aws-rethinkdb-url", "AWS_RETHINKDB_PORT": "@aws-rethinkdb-port", diff --git a/package.json b/package.json index 1b88f4ff83..d6fe378e48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Spectrum", - "version": "3.1.11", + "version": "3.1.12", "license": "BSD-3-Clause", "devDependencies": { "@babel/preset-flow": "^7.0.0", diff --git a/shared/imgix/sign.js b/shared/imgix/sign.js index 932bfef359..ce3c42a773 100644 --- a/shared/imgix/sign.js +++ b/shared/imgix/sign.js @@ -36,7 +36,7 @@ const defaultOpts = { const signPrimary = (url: string, opts: Opts = defaultOpts): string => { const client = new ImgixClient({ - domains: ['spectrum.imgix.net'], + domains: 'spectrum.imgix.net', secureURLToken: process.env.IMGIX_SECURITY_KEY, }); return client.buildURL(url, opts); @@ -44,7 +44,7 @@ const signPrimary = (url: string, opts: Opts = defaultOpts): string => { const signProxy = (url: string, opts?: Opts = defaultOpts): string => { const client = new ImgixClient({ - domains: ['spectrum-proxy.imgix.net'], + domains: 'spectrum-proxy.imgix.net', secureURLToken: process.env.IMGIX_PROXY_SECURITY_KEY, }); return client.buildURL(url, opts);