Merged PR 232: Typistの音声ファイル取得で失敗する件の調査・修正

## 概要
[Task2172: Typistの音声ファイル取得で失敗する件の調査・修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2172)

- 音声ファイルダウンロードURLの取得時にTypistの場合、音声ファイルが見つからない問題を修正しました。
  - ファイルパスを構築する際に実行ユーザーIDを材料にしていたのでTypistの場合が存在しないパスとなっていました。
  - ファイル所有者IDから構成するように修正しました。

## レビューポイント
- ファイルパスの作り方に問題はないか

## UIの変更
なし

## 動作確認状況
- ローカルで確認
This commit is contained in:
makabe.t 2023-07-12 00:06:14 +00:00
parent 883224c914
commit 6f92313e9a
2 changed files with 19 additions and 3 deletions

View File

@ -340,7 +340,15 @@ describe('音声ファイルダウンロードURL取得', () => {
'typist-user-external-id',
'typist',
);
const url = `https://saodmsusdev.blob.core.windows.net/account-${accountId}/${userId}`;
const { userId: authorUserId } = await createUser(
source,
accountId,
'author-user-external-id',
'author',
'AUTHOR_ID',
);
const url = `https://saodmsusdev.blob.core.windows.net/account-${accountId}/${authorUserId}`;
const { audioFileId } = await createTask(
source,
@ -379,7 +387,14 @@ describe('音声ファイルダウンロードURL取得', () => {
'other-typist-user-external-id',
'typist',
);
const url = `https://saodmsusdev.blob.core.windows.net/account-${accountId}/${userId}`;
const { userId: authorUserId } = await createUser(
source,
accountId,
'author-user-external-id',
'author',
'AUTHOR_ID',
);
const url = `https://saodmsusdev.blob.core.windows.net/account-${accountId}/${authorUserId}`;
const { audioFileId } = await createTask(
source,

View File

@ -291,7 +291,7 @@ export class FilesService {
);
}
const filePath = `${userId}/${file.file_name}`;
const filePath = `${file.owner_user_id}/${file.file_name}`;
const isFileExist = await this.blobStorageService.fileExists(
accountId,
@ -300,6 +300,7 @@ export class FilesService {
);
if (!isFileExist) {
this.logger.log(`filePath:${filePath}`);
throw new AudioFileNotFoundError(
`Audio file is not exists in blob storage. audio_file_id:${audioFileId}, url:${file.url}, fileName:${file.file_name}`,
);