ActivityPub-federated video streaming platform using P2P directly in your web browser
Remove unused actor uuid field
Chocobozzz57cfff78858b
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.html b/client/src/app/+accounts/account-video-channels/account-video-channels.component.htmlindex 25b74027ec..43dbbebb3b 100644--- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.html+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.html@@ -1,5 +1,7 @@<div class="margin-content">+ <div class="no-results" i18n *ngIf="channelPagination.totalItems === 0">This account does not have channels.</div>+<div class="channels" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [autoInit]="true"><div class="section channel" *ngFor="let videoChannel of videoChannels"><div class="section-title">diff --git a/client/src/app/shared/actor/actor.model.ts b/client/src/app/shared/actor/actor.model.tsindex adecec1fce..5a517c975b 100644--- a/client/src/app/shared/actor/actor.model.ts+++ b/client/src/app/shared/actor/actor.model.ts@@ -4,7 +4,6 @@ import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'export abstract class Actor implements ActorServer {id: number- uuid: stringurl: stringname: stringhost: string@@ -35,7 +34,6 @@ export abstract class Actor implements ActorServer {protected constructor (hash: ActorServer) {this.id = hash.id- this.uuid = hash.uuidthis.url = hash.urlthis.name = hash.namethis.host = hash.hostdiff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.shindex 5694ac9225..34afd6a9d0 100755--- a/scripts/clean/server/test.sh+++ b/scripts/clean/server/test.sh@@ -17,8 +17,11 @@ removeFiles () {}dropRedis () {- redis-cli KEYS "bull-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL- redis-cli KEYS "redis-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL+ port=$((9000+$1))++ redis-cli KEYS "bull-localhost:$port*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL+ redis-cli KEYS "redis-localhost:$port*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL+ redis-cli KEYS "*redis-localhost:$port-" | grep -v empty | xargs --no-run-if-empty redis-cli DEL}seq=$(seq 1 6)diff --git a/scripts/test.sh b/scripts/test.shindex cf88953652..5ec7a59205 100755--- a/scripts/test.sh+++ b/scripts/test.sh@@ -3,6 +3,8 @@set -eunpm run build:server+npm run setup:cli+npm run travis -- lintmocha --exit --require ts-node/register/type-check --bail server/tests/index.tsdiff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.tsindex a04f778417..2e03587ce2 100644--- a/server/controllers/api/users/index.ts+++ b/server/controllers/api/users/index.ts@@ -190,8 +190,7 @@ async function createUser (req: express.Request, res: express.Response) {user: {id: user.id,account: {- id: account.id,- uuid: account.Actor.uuid+ id: account.id}}}).end()diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.tsindex 3d6dbfe701..c98a39be28 100644--- a/server/controllers/api/video-channel.ts+++ b/server/controllers/api/video-channel.ts@@ -143,15 +143,14 @@ async function addVideoChannel (req: express.Request, res: express.Response) {})setAsyncActorKeys(videoChannelCreated.Actor)- .catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.uuid, { err }))+ .catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.url, { err }))auditLogger.create(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannelCreated.toFormattedJSON()))- logger.info('Video channel with uuid %s created.', videoChannelCreated.Actor.uuid)+ logger.info('Video channel %s created.', videoChannelCreated.Actor.url)return res.json({videoChannel: {- id: videoChannelCreated.id,- uuid: videoChannelCreated.Actor.uuid+ id: videoChannelCreated.id}}).end()}@@ -180,7 +179,7 @@ async function updateVideoChannel (req: express.Request, res: express.Response)new VideoChannelAuditView(videoChannelInstanceUpdated.toFormattedJSON()),oldVideoChannelAuditKeys)- logger.info('Video channel with name %s and uuid %s updated.', videoChannelInstance.name, videoChannelInstance.Actor.uuid)+ logger.info('Video channel %s updated.', videoChannelInstance.Actor.url)})} catch (err) {logger.debug('Cannot update the video channel.', { err })@@ -205,7 +204,7 @@ async function removeVideoChannel (req: express.Request, res: express.Response)await videoChannelInstance.destroy({ transaction: t })auditLogger.delete(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannelInstance.toFormattedJSON()))- logger.info('Video channel with name %s and uuid %s deleted.', videoChannelInstance.name, videoChannelInstance.Actor.uuid)+ logger.info('Video channel %s deleted.', videoChannelInstance.Actor.url)})return res.type('json').status(204).end()diff --git a/server/helpers/custom-validators/accounts.ts b/server/helpers/custom-validators/accounts.tsindex 146c7708e2..31a2de5ca6 100644--- a/server/helpers/custom-validators/accounts.ts+++ b/server/helpers/custom-validators/accounts.ts@@ -1,7 +1,6 @@import * as Bluebird from 'bluebird'import { Response } from 'express'import 'express-validator'-import * as validator from 'validator'import { AccountModel } from '../../models/account/account'import { isUserDescriptionValid, isUserUsernameValid } from './users'import { exists } from './misc'@@ -18,14 +17,8 @@ function isAccountDescriptionValid (value: string) {return isUserDescriptionValid(value)}-function doesAccountIdExist (id: number | string, res: Response, sendNotFound = true) {- let promise: Bluebird<AccountModel>-- if (validator.isInt('' + id)) {- promise = AccountModel.load(+id)- } else { // UUID- promise = AccountModel.loadByUUID('' + id)- }+function doesAccountIdExist (id: number, res: Response, sendNotFound = true) {+ const promise = AccountModel.load(id)return doesAccountExist(promise, res, sendNotFound)}diff --git a/server/helpers/custom-validators/video-channels.ts b/server/helpers/custom-validators/video-channels.tsindex fd56b9a703..f818ce8f1a 100644--- a/server/helpers/custom-validators/video-channels.ts+++ b/server/helpers/custom-validators/video-channels.ts@@ -26,13 +26,8 @@ async function doesLocalVideoChannelNameExist (name: string, res: express.Responreturn processVideoChannelExist(videoChannel, res)}-async function doesVideoChannelIdExist (id: number | string, res: express.Response) {- let videoChannel: VideoChannelModel- if (validator.isInt('' + id)) {- videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id)- } else { // UUID- videoChannel = await VideoChannelModel.loadByUUIDAndPopulateAccount('' + id)- }+async function doesVideoChannelIdExist (id: number, res: express.Response) {+ const videoChannel = await VideoChannelModel.loadAndPopulateAccount(+id)return processVideoChannelExist(videoChannel, res)}diff --git a/server/initializers/constants.ts b/server/initializers/constants.tsindex ec040b80e4..be30be4634 100644--- a/server/initializers/constants.ts+++ b/server/initializers/constants.ts@@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'// ----------------------------------------------------------------------------const LAST_MIGRATION_VERSION = 380+const LAST_MIGRATION_VERSION = 385// ---------------------------------------------------------------------------diff --git a/server/initializers/migrations/0385-remove-actor-uuid.ts b/server/initializers/migrations/0385-remove-actor-uuid.tsnew file mode 100644index 0000000000..032c0562bc--- /dev/null+++ b/server/initializers/migrations/0385-remove-actor-uuid.ts@@ -0,0 +1,19 @@+import * as Sequelize from 'sequelize'++async function up (utils: {+ transaction: Sequelize.Transaction,+ queryInterface: Sequelize.QueryInterface,+ sequelize: Sequelize.Sequelize,+ db: any+}): Promise<void> {+ await utils.queryInterface.removeColumn('actor', 'uuid')+}++function down (options) {+ throw new Error('Not implemented.')+}++export {+ up,+ down+}diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.tsindex 25cd40905b..e0cb986bdf 100644--- a/server/lib/activitypub/actor.ts+++ b/server/lib/activitypub/actor.ts@@ -33,7 +33,7 @@ function setAsyncActorKeys (actor: ActorModel) {return actor.save()}).catch(err => {- logger.error('Cannot set public/private keys of actor %d.', actor.uuid, { err })+ logger.error('Cannot set public/private keys of actor %d.', actor.url, { err })return actor})}@@ -128,18 +128,17 @@ async function updateActorInstance (actorInstance: ActorModel, attributes: Activconst followersCount = await fetchActorTotalItems(attributes.followers)const followingCount = await fetchActorTotalItems(attributes.following)- actorInstance.set('type', attributes.type)- actorInstance.set('uuid', attributes.uuid)- actorInstance.set('preferredUsername', attributes.preferredUsername)- actorInstance.set('url', attributes.id)- actorInstance.set('publicKey', attributes.publicKey.publicKeyPem)- actorInstance.set('followersCount', followersCount)- actorInstance.set('followingCount', followingCount)- actorInstance.set('inboxUrl', attributes.inbox)- actorInstance.set('outboxUrl', attributes.outbox)- actorInstance.set('sharedInboxUrl', attributes.endpoints.sharedInbox)- actorInstance.set('followersUrl', attributes.followers)- actorInstance.set('followingUrl', attributes.following)+ actorInstance.type = attributes.type+ actorInstance.preferredUsername = attributes.preferredUsername+ actorInstance.url = attributes.id+ actorInstance.publicKey = attributes.publicKey.publicKeyPem+ actorInstance.followersCount = followersCount+ actorInstance.followingCount = followingCount+ actorInstance.inboxUrl = attributes.inbox+ actorInstance.outboxUrl = attributes.outbox+ actorInstance.sharedInboxUrl = attributes.endpoints.sharedInbox+ actorInstance.followersUrl = attributes.followers+ actorInstance.followingUrl = attributes.following}async function updateActorAvatarInstance (actorInstance: ActorModel, avatarName: string, t: Transaction) {@@ -388,7 +387,6 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode?: numbeconst actor = new ActorModel({type: actorJSON.type,- uuid: actorJSON.uuid,preferredUsername: actorJSON.preferredUsername,url: actorJSON.id,publicKey: actorJSON.publicKey.publicKeyPem,diff --git a/server/lib/activitypub/process/process-delete.ts b/server/lib/activitypub/process/process-delete.tsindex 76f07fd8a8..6f10a50bdc 100644--- a/server/lib/activitypub/process/process-delete.ts+++ b/server/lib/activitypub/process/process-delete.ts@@ -95,23 +95,23 @@ async function processDeleteVideoPlaylist (actor: ActorModel, playlistToDelete:}async function processDeleteAccount (accountToRemove: AccountModel) {- logger.debug('Removing remote account "%s".', accountToRemove.Actor.uuid)+ logger.debug('Removing remote account "%s".', accountToRemove.Actor.url)await sequelizeTypescript.transaction(async t => {await accountToRemove.destroy({ transaction: t })})- logger.info('Remote account with uuid %s removed.', accountToRemove.Actor.uuid)+ logger.info('Remote account %s removed.', accountToRemove.Actor.url)}async function processDeleteVideoChannel (videoChannelToRemove: VideoChannelModel) {- logger.debug('Removing remote video channel "%s".', videoChannelToRemove.Actor.uuid)+ logger.debug('Removing remote video channel "%s".', videoChannelToRemove.Actor.url)await sequelizeTypescript.transaction(async t => {await videoChannelToRemove.destroy({ transaction: t })})- logger.info('Remote video channel with uuid %s removed.', videoChannelToRemove.Actor.uuid)+ logger.info('Remote video channel %s removed.', videoChannelToRemove.Actor.url)}function processDeleteVideoComment (byActor: ActorModel, videoComment: VideoCommentModel, activity: ActivityDelete) {diff --git a/server/lib/activitypub/process/process-update.ts b/server/lib/activitypub/process/process-update.tsindex 54a9234bb1..71a16daccd 100644--- a/server/lib/activitypub/process/process-update.ts+++ b/server/lib/activitypub/process/process-update.ts@@ -95,7 +95,7 @@ async function processUpdateCacheFile (byActor: ActorModel, activity: ActivityUpasync function processUpdateActor (actor: ActorModel, activity: ActivityUpdate) {const actorAttributesToUpdate = activity.object as ActivityPubActor- logger.debug('Updating remote account "%s".', actorAttributesToUpdate.uuid)+ logger.debug('Updating remote account "%s".', actorAttributesToUpdate.url)let accountOrChannelInstance: AccountModel | VideoChannelModellet actorFieldsSave: objectlet accountOrChannelFieldsSave: object@@ -128,7 +128,7 @@ async function processUpdateActor (actor: ActorModel, activity: ActivityUpdate)await accountOrChannelInstance.save({ transaction: t })})- logger.info('Remote account with uuid %s updated', actorAttributesToUpdate.uuid)+ logger.info('Remote account %s updated', actorAttributesToUpdate.url)} catch (err) {if (actor !== undefined && actorFieldsSave !== undefined) {resetSequelizeInstance(actor, actorFieldsSave)diff --git a/server/middlewares/validators/feeds.ts b/server/middlewares/validators/feeds.tsindex e4f5c98fe3..dd362619d6 100644--- a/server/middlewares/validators/feeds.ts+++ b/server/middlewares/validators/feeds.ts@@ -1,21 +1,20 @@import * as express from 'express'import { param, query } from 'express-validator/check'-import { doesAccountIdExist, isAccountNameValid, doesAccountNameWithHostExist } from '../../helpers/custom-validators/accounts'-import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'+import { doesAccountIdExist, doesAccountNameWithHostExist } from '../../helpers/custom-validators/accounts'+import { isIdOrUUIDValid, isIdValid } from '../../helpers/custom-validators/misc'import { logger } from '../../helpers/logger'import { areValidationErrors } from './utils'import { isValidRSSFeed } from '../../helpers/custom-validators/feeds'import { doesVideoChannelIdExist, doesVideoChannelNameWithHostExist } from '../../helpers/custom-validators/video-channels'import { doesVideoExist } from '../../helpers/custom-validators/videos'-import { isActorPreferredUsernameValid } from '../../helpers/custom-validators/activitypub/actor'const videoFeedsValidator = [param('format').optional().custom(isValidRSSFeed).withMessage('Should have a valid format (rss, atom, json)'),query('format').optional().custom(isValidRSSFeed).withMessage('Should have a valid format (rss, atom, json)'),- query('accountId').optional().custom(isIdOrUUIDValid),- query('accountName').optional().custom(isAccountNameValid),- query('videoChannelId').optional().custom(isIdOrUUIDValid),- query('videoChannelName').optional().custom(isActorPreferredUsernameValid),+ query('accountId').optional().custom(isIdValid),+ query('accountName').optional(),+ query('videoChannelId').optional().custom(isIdValid),+ query('videoChannelName').optional(),async (req: express.Request, res: express.Response, next: express.NextFunction) => {logger.debug('Checking feeds parameters', { parameters: req.query })diff --git a/server/models/account/account.ts b/server/models/account/account.tsindex 2b04acd863..09cada0967 100644--- a/server/models/account/account.ts+++ b/server/models/account/account.ts@@ -47,7 +47,7 @@ export enum ScopeNames {attributes: [ 'id', 'name' ],include: [{- attributes: [ 'id', 'uuid', 'preferredUsername', 'url', 'serverId', 'avatarId' ],+ attributes: [ 'id', 'preferredUsername', 'url', 'serverId', 'avatarId' ],model: ActorModel.unscoped(),required: true,where: whereActor,@@ -180,22 +180,6 @@ export class AccountModel extends Model<AccountModel> {return AccountModel.findByPk(id, { transaction })}- static loadByUUID (uuid: string) {- const query = {- include: [- {- model: ActorModel,- required: true,- where: {- uuid- }- }- ]- }-- return AccountModel.findOne(query)- }-static loadByNameWithHost (nameWithHost: string) {const [ accountName, host ] = nameWithHost.split('@')@@ -332,7 +316,6 @@ export class AccountModel extends Model<AccountModel> {return {id: this.id,- uuid: actor.uuid,name: actor.name,displayName: this.getDisplayName(),url: actor.url,diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.tsindex 4a466441cd..bd6a2c8fdb 100644--- a/server/models/activitypub/actor.ts+++ b/server/models/activitypub/actor.ts@@ -7,13 +7,11 @@ import {Column,CreatedAt,DataType,- Default,DefaultScope,ForeignKey,HasMany,HasOne,Is,- IsUUID,Model,Scopes,Table,@@ -119,10 +117,6 @@ export const unusedActorAttributesForAPI = [{fields: [ 'avatarId' ]},- {- fields: [ 'uuid' ],- unique: true- },{fields: [ 'followersUrl' ]}@@ -134,12 +128,6 @@ export class ActorModel extends Model<ActorModel> {@Column(DataType.ENUM(...values(ACTIVITY_PUB_ACTOR_TYPES)))type: ActivityPubActorType- @AllowNull(false)- @Default(DataType.UUIDV4)- @IsUUID(4)- @Column(DataType.UUID)- uuid: string-@AllowNull(false)@Is('ActorPreferredUsername', value => throwIfNotValid(value, isActorPreferredUsernameValid, 'actor preferred username'))@Column@@ -408,7 +396,6 @@ export class ActorModel extends Model<ActorModel> {return {id: this.id,url: this.url,- uuid: this.uuid,name: this.preferredUsername,host: this.getHost(),hostRedundancyAllowed: this.getRedundancyAllowed(),@@ -454,7 +441,6 @@ export class ActorModel extends Model<ActorModel> {endpoints: {sharedInbox: this.sharedInboxUrl},- uuid: this.uuid,publicKey: {id: this.getPublicKeyUrl(),owner: this.url,diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.tsindex d73be18d66..b0b261c88a 100644--- a/server/models/video/video-channel.ts+++ b/server/models/video/video-channel.ts@@ -72,7 +72,7 @@ type AvailableForListOptions = {attributes: [ 'name', 'description', 'id', 'actorId' ],include: [{- attributes: [ 'uuid', 'preferredUsername', 'url', 'serverId', 'avatarId' ],+ attributes: [ 'preferredUsername', 'url', 'serverId', 'avatarId' ],model: ActorModel.unscoped(),required: true,include: [@@ -387,24 +387,6 @@ export class VideoChannelModel extends Model<VideoChannelModel> {.findByPk(id)}- static loadByUUIDAndPopulateAccount (uuid: string) {- const query = {- include: [- {- model: ActorModel,- required: true,- where: {- uuid- }- }- ]- }-- return VideoChannelModel- .scope([ ScopeNames.WITH_ACCOUNT ])- .findOne(query)- }-static loadByUrlAndPopulateAccount (url: string) {const query = {include: [@@ -510,7 +492,6 @@ export class VideoChannelModel extends Model<VideoChannelModel> {return {id: this.id,- uuid: actor.uuid,name: actor.name,displayName: this.getDisplayName(),url: actor.url,diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.tsindex 988fdad3f9..7914183188 100644--- a/server/tests/api/users/users-multiple-servers.ts+++ b/server/tests/api/users/users-multiple-servers.ts@@ -5,7 +5,8 @@ import 'mocha'import { Account } from '../../../../shared/models/actors'import {checkTmpIsEmpty,- checkVideoFilesWereRemoved, cleanupTests,+ checkVideoFilesWereRemoved,+ cleanupTests,createUser,doubleFollow,flushAndRunMultipleServers,@@ -15,14 +16,7 @@ import {updateMyUser,userLogin} from '../../../../shared/extra-utils'-import {- getMyUserInformation,- killallServers,- ServerInfo,- testImage,- updateMyAvatar,- uploadVideo-} from '../../../../shared/extra-utils/index'+import { getMyUserInformation, ServerInfo, testImage, updateMyAvatar, uploadVideo } from '../../../../shared/extra-utils/index'import { checkActorFilesWereRemoved, getAccount, getAccountsList } from '../../../../shared/extra-utils/users/accounts'import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login'import { User } from '../../../../shared/models/users'@@ -34,12 +28,10 @@ const expect = chai.expectdescribe('Test users with multiple servers', function () {let servers: ServerInfo[] = []let user: User- let userAccountName: string- let userAccountUUID: string- let userVideoChannelUUID: stringlet userId: numberlet videoUUID: stringlet userAccessToken: string+ let userAvatarFilename: stringbefore(async function () {this.timeout(120000)@@ -74,19 +66,6 @@ describe('Test users with multiple servers', function () {userAccessToken = await userLogin(servers[ 0 ], user)}- {- const res = await getMyUserInformation(servers[0].url, userAccessToken)- const account: Account = res.body.account- userAccountName = account.name + '@' + account.host- userAccountUUID = account.uuid- }-- {- const res = await getMyUserInformation(servers[ 0 ].url, servers[ 0 ].accessToken)- const user: User = res.body- userVideoChannelUUID = user.videoChannels[0].uuid- }-{const resVideo = await uploadVideo(servers[ 0 ].url, userAccessToken, {})videoUUID = resVideo.body.video.uuid@@ -106,6 +85,8 @@ describe('Test users with multiple servers', function () {const res = await getMyUserInformation(servers[0].url, servers[0].accessToken)user = res.body++ const account: Account = user.accountexpect(user.account.displayName).to.equal('my super display name')await waitJobs(servers)@@ -142,7 +123,9 @@ describe('Test users with multiple servers', function () {const res = await getMyUserInformation(servers[0].url, servers[0].accessToken)user = res.body- await testImage(servers[0].url, 'avatar2-resized', user.account.avatar.path, '.png')+ userAvatarFilename = user.account.avatar.path++ await testImage(servers[0].url, 'avatar2-resized', userAvatarFilename, '.png')await waitJobs(servers)})@@ -173,7 +156,7 @@ describe('Test users with multiple servers', function () {it('Should list account videos', async function () {for (const server of servers) {- const res = await getAccountVideos(server.url, server.accessToken, userAccountName, 0, 5)+ const res = await getAccountVideos(server.url, server.accessToken, 'user1@localhost:' + servers[0].port, 0, 5)expect(res.body.total).to.equal(1)expect(res.body.data).to.be.an('array')@@ -218,8 +201,7 @@ describe('Test users with multiple servers', function () {it('Should not have actor files', async () => {for (const server of servers) {- await checkActorFilesWereRemoved(userAccountUUID, server.internalServerNumber)- await checkActorFilesWereRemoved(userVideoChannelUUID, server.internalServerNumber)+ await checkActorFilesWereRemoved(userAvatarFilename, server.internalServerNumber)}})diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.tsindex e98f14ea81..2d298dd3f5 100644--- a/server/tests/api/videos/video-channels.ts+++ b/server/tests/api/videos/video-channels.ts@@ -18,12 +18,10 @@ import {import {addVideoChannel,deleteVideoChannel,- flushTests,getAccountVideoChannelsList,getMyUserInformation,getVideoChannel,getVideoChannelsList,- killallServers,ServerInfo,setAccessTokensToServers,updateVideoChannel@@ -35,7 +33,6 @@ const expect = chai.expectdescribe('Test video channels', function () {let servers: ServerInfo[]let userInfo: User- let accountUUID: stringlet firstVideoChannelId: numberlet secondVideoChannelId: numberlet videoUUID: string@@ -51,7 +48,6 @@ describe('Test video channels', function () {{const res = await getMyUserInformation(servers[0].url, servers[0].accessToken)const user: User = res.body- accountUUID = user.account.uuidfirstVideoChannelId = user.videoChannels[0].id}diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.tsindex 0dcdf09cf1..437470327b 100644--- a/server/tests/feeds/feeds.ts+++ b/server/tests/feeds/feeds.ts@@ -7,13 +7,13 @@ import {createUser,doubleFollow,flushAndRunMultipleServers,- flushTests,- getJSONfeed, getMyUserInformation,+ getJSONfeed,+ getMyUserInformation,getXMLfeed,- killallServers,ServerInfo,setAccessTokensToServers,- uploadVideo, userLogin+ uploadVideo,+ userLogin} from '../../../shared/extra-utils'import * as libxmljs from 'libxmljs'import { addVideoCommentThread } from '../../../shared/extra-utils/videos/video-comments'@@ -28,10 +28,10 @@ const expect = chai.expectdescribe('Test syndication feeds', () => {let servers: ServerInfo[] = []let userAccessToken: string- let rootAccountUUID: string- let rootChannelUUID: string- let userAccountUUID: string- let userChannelUUID: string+ let rootAccountId: number+ let rootChannelId: number+ let userAccountId: number+ let userChannelId: numberbefore(async function () {this.timeout(120000)@@ -45,8 +45,8 @@ describe('Test syndication feeds', () => {{const res = await getMyUserInformation(servers[0].url, servers[0].accessToken)const user: User = res.body- rootAccountUUID = user.account.uuid- rootChannelUUID = user.videoChannels[0].uuid+ rootAccountId = user.account.id+ rootChannelId = user.videoChannels[0].id}{@@ -56,8 +56,8 @@ describe('Test syndication feeds', () => {const res = await getMyUserInformation(servers[0].url, userAccessToken)const user: User = res.body- userAccountUUID = user.account.uuid- userChannelUUID = user.videoChannels[0].uuid+ userAccountId = user.account.id+ userChannelId = user.videoChannels[0].id}{@@ -127,71 +127,71 @@ describe('Test syndication feeds', () => {})it('Should filter by account', async function () {+ {+ const json = await getJSONfeed(servers[0].url, 'videos', { accountId: rootAccountId })+ const jsonObj = JSON.parse(json.text)+ expect(jsonObj.items.length).to.be.equal(1)+ expect(jsonObj.items[ 0 ].title).to.equal('my super name for server 1')+ expect(jsonObj.items[ 0 ].author.name).to.equal('root')+ }++ {+ const json = await getJSONfeed(servers[0].url, 'videos', { accountId: userAccountId })+ const jsonObj = JSON.parse(json.text)+ expect(jsonObj.items.length).to.be.equal(1)+ expect(jsonObj.items[ 0 ].title).to.equal('user video')+ expect(jsonObj.items[ 0 ].author.name).to.equal('john')+ }+for (const server of servers) {{- const json = await getJSONfeed(server.url, 'videos', { accountId: rootAccountUUID })+ const json = await getJSONfeed(server.url, 'videos', { accountName: 'root@localhost:' + servers[0].port })const jsonObj = JSON.parse(json.text)expect(jsonObj.items.length).to.be.equal(1)expect(jsonObj.items[ 0 ].title).to.equal('my super name for server 1')- expect(jsonObj.items[ 0 ].author.name).to.equal('root')}{- const json = await getJSONfeed(server.url, 'videos', { accountId: userAccountUUID })+ const json = await getJSONfeed(server.url, 'videos', { accountName: 'john@localhost:' + servers[0].port })const jsonObj = JSON.parse(json.text)expect(jsonObj.items.length).to.be.equal(1)expect(jsonObj.items[ 0 ].title).to.equal('user video')- expect(jsonObj.items[ 0 ].author.name).to.equal('john')}}+ })+ it('Should filter by video channel', async function () {{- const json = await getJSONfeed(servers[0].url, 'videos', { accountName: 'root' })+ const json = await getJSONfeed(servers[0].url, 'videos', { videoChannelId: rootChannelId })const jsonObj = JSON.parse(json.text)expect(jsonObj.items.length).to.be.equal(1)expect(jsonObj.items[ 0 ].title).to.equal('my super name for server 1')+ expect(jsonObj.items[ 0 ].author.name).to.equal('root')}{- const json = await getJSONfeed(servers[0].url, 'videos', { accountName: 'john' })+ const json = await getJSONfeed(servers[0].url, 'videos', { videoChannelId: userChannelId })const jsonObj = JSON.parse(json.text)expect(jsonObj.items.length).to.be.equal(1)expect(jsonObj.items[ 0 ].title).to.equal('user video')+ expect(jsonObj.items[ 0 ].author.name).to.equal('john')}- })- it('Should filter by video channel', async function () {for (const server of servers) {{- const json = await getJSONfeed(server.url, 'videos', { videoChannelId: rootChannelUUID })+ const json = await getJSONfeed(server.url, 'videos', { videoChannelName: 'root_channel@localhost:' + servers[0].port })const jsonObj = JSON.parse(json.text)expect(jsonObj.items.length).to.be.equal(1)expect(jsonObj.items[ 0 ].title).to.equal('my super name for server 1')- expect(jsonObj.items[ 0 ].author.name).to.equal('root')}{- const json = await getJSONfeed(server.url, 'videos', { videoChannelId: userChannelUUID })+ const json = await getJSONfeed(server.url, 'videos', { videoChannelName: 'john_channel@localhost:' + servers[0].port })const jsonObj = JSON.parse(json.text)expect(jsonObj.items.length).to.be.equal(1)expect(jsonObj.items[ 0 ].title).to.equal('user video')- expect(jsonObj.items[ 0 ].author.name).to.equal('john')}}-- {- const json = await getJSONfeed(servers[0].url, 'videos', { videoChannelName: 'root_channel' })- const jsonObj = JSON.parse(json.text)- expect(jsonObj.items.length).to.be.equal(1)- expect(jsonObj.items[ 0 ].title).to.equal('my super name for server 1')- }-- {- const json = await getJSONfeed(servers[0].url, 'videos', { videoChannelName: 'john_channel' })- const jsonObj = JSON.parse(json.text)- expect(jsonObj.items.length).to.be.equal(1)- expect(jsonObj.items[ 0 ].title).to.equal('user video')- }})})diff --git a/shared/extra-utils/users/accounts.ts b/shared/extra-utils/users/accounts.tsindex f64a2dbad6..627e17cc3a 100644--- a/shared/extra-utils/users/accounts.ts+++ b/shared/extra-utils/users/accounts.ts@@ -39,7 +39,7 @@ async function expectAccountFollows (url: string, nameWithDomain: string, followexpect(account.followingCount).to.equal(followingCount, message)}-async function checkActorFilesWereRemoved (actorUUID: string, serverNumber: number) {+async function checkActorFilesWereRemoved (filename: string, serverNumber: number) {const testDirectory = 'test' + serverNumberfor (const directory of [ 'avatars' ]) {@@ -50,7 +50,7 @@ async function checkActorFilesWereRemoved (actorUUID: string, serverNumber: numbconst files = await readdir(directoryPath)for (const file of files) {- expect(file).to.not.contain(actorUUID)+ expect(file).to.not.contain(filename)}}}diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.tsindex b64de24707..a4ca43f261 100644--- a/shared/extra-utils/videos/videos.ts+++ b/shared/extra-utils/videos/videos.ts@@ -524,7 +524,6 @@ async function completeVideoCheck (expect(video.nsfw).to.equal(attributes.nsfw)expect(video.description).to.equal(attributes.description)expect(video.account.id).to.be.a('number')- expect(video.account.uuid).to.be.a('string')expect(video.account.host).to.equal(attributes.account.host)expect(video.account.name).to.equal(attributes.account.name)expect(video.channel.displayName).to.equal(attributes.channel.displayName)diff --git a/shared/models/activitypub/activitypub-actor.ts b/shared/models/activitypub/activitypub-actor.tsindex 5e30bf783b..53ec579bcc 100644--- a/shared/models/activitypub/activitypub-actor.ts+++ b/shared/models/activitypub/activitypub-actor.ts@@ -21,7 +21,6 @@ export interface ActivityPubActor {attributedTo: ActivityPubAttributedTo[]support?: string- uuid: stringpublicKey: {id: stringowner: stringdiff --git a/shared/models/actors/account.model.ts b/shared/models/actors/account.model.tsindex 043a2507e3..2ff4b9f5ea 100644--- a/shared/models/actors/account.model.ts+++ b/shared/models/actors/account.model.ts@@ -10,7 +10,6 @@ export interface Account extends Actor {export interface AccountSummary {id: number- uuid: stringname: stringdisplayName: stringurl: stringdiff --git a/shared/models/actors/actor.model.ts b/shared/models/actors/actor.model.tsindex a3953874d0..1dbf5f6387 100644--- a/shared/models/actors/actor.model.ts+++ b/shared/models/actors/actor.model.ts@@ -2,7 +2,6 @@ import { Avatar } from '../avatars/avatar.model'export interface Actor {id: number- uuid: stringurl: stringname: stringhost: stringdiff --git a/shared/models/videos/channel/video-channel.model.ts b/shared/models/videos/channel/video-channel.model.tsindex 14a813f8f7..de4c26b3dd 100644--- a/shared/models/videos/channel/video-channel.model.ts+++ b/shared/models/videos/channel/video-channel.model.ts@@ -12,7 +12,6 @@ export interface VideoChannel extends Actor {export interface VideoChannelSummary {id: number- uuid: stringname: stringdisplayName: stringurl: string