Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@

import {useState, useCallback, useRef, SyntheticEvent} from 'react';

import {amplify} from 'amplify';

import {WebAppEvents} from '@wireapp/webapp-events';

import {EventName} from 'Repositories/tracking/EventName';

import {isVideoPlayable} from './isVideoPlayable/isVideoPlayable';

interface UseVideoPlaybackProps {
Expand Down Expand Up @@ -59,8 +53,9 @@
if (!playable) {
const status = 'unplayable';

amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR);
// Todo: This needs to be revisited

Check warning on line 56 in src/script/components/MessagesList/Message/ContentMessage/asset/MultipartAssets/VideoAssetCard/VideoAssetPlayer/useVideoPlayback/useVideoPlayback.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=wireapp_wire-webapp&issues=AZrgAt17VOp-QAgK5IDH&open=AZrgAt17VOp-QAgK5IDH&pullRequest=19829
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent comment format: "Todo" should be "TODO" (standard task marker format). Also note this file uses "Todo" while VideoAsset.tsx uses "ToDo" - both should be standardized to "TODO".

Copilot uses AI. Check for mistakes.
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR);
setIsError(true);
playabilityStatusRef.current = status;
return status;
Expand Down Expand Up @@ -108,7 +103,8 @@

const handleError = useCallback((event: SyntheticEvent<HTMLVideoElement>) => {
setIsError(true);
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// Todo: This needs to be revisited

Check warning on line 106 in src/script/components/MessagesList/Message/ContentMessage/asset/MultipartAssets/VideoAssetCard/VideoAssetPlayer/useVideoPlayback/useVideoPlayback.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=wireapp_wire-webapp&issues=AZrgAt17VOp-QAgK5IDI&open=AZrgAt17VOp-QAgK5IDI&pullRequest=19829
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent comment format: "Todo" should be "TODO" (standard task marker format).

Suggested change
// Todo: This needs to be revisited
// TODO: This needs to be revisited

Copilot uses AI. Check for mistakes.
//amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after // in comment. For consistency with line 56 in this file, add a space: // amplify.publish

Suggested change
//amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);

Copilot uses AI. Check for mistakes.
console.error('Video cannot be played', event);
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@

import {useCallback, useEffect, useState} from 'react';

import {amplify} from 'amplify';
import cx from 'classnames';
import {container} from 'tsyringe';

import {TabIndex, Button, ButtonVariant, useTimeout} from '@wireapp/react-ui-kit';
import {WebAppEvents} from '@wireapp/webapp-events';

import {RestrictedVideo} from 'Components/asset/RestrictedVideo';
import {AssetError} from 'Repositories/assets/AssetError';
Expand All @@ -33,7 +31,6 @@
import type {ContentMessage} from 'Repositories/entity/message/ContentMessage';
import type {FileAsset as FileAssetType} from 'Repositories/entity/message/FileAsset';
import {TeamState} from 'Repositories/team/TeamState';
import {EventName} from 'Repositories/tracking/EventName';
import {useKoSubscribableChildren} from 'Util/ComponentUtil';
import {t} from 'Util/LocalizerUtil';
import {formatSeconds} from 'Util/TimeUtil';
Expand Down Expand Up @@ -94,10 +91,11 @@
const video = document.createElement('video');
const canPlay = video.canPlayType(mimeType) !== '';

if (!canPlay) {
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNSUPPORTED_MIME_TYPE);
}
// ToDo: This needs to be revisited

Check warning on line 94 in src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=wireapp_wire-webapp&issues=AZrgAt7pVOp-QAgK5IDJ&open=AZrgAt7pVOp-QAgK5IDJ&pullRequest=19829
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent TODO format. The codebase uses "Todo" in the other file (useVideoPlayback.ts:56) but "ToDo" here. Please standardize to one format for consistency.

Suggested change
// ToDo: This needs to be revisited
// Todo: This needs to be revisited

Copilot uses AI. Check for mistakes.
// if (!canPlay) {
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNSUPPORTED_MIME_TYPE);
// }
Comment on lines +95 to +98
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] Commented-out code should generally be removed rather than left in the codebase. If this tracking is truly temporary and will be revisited soon, consider:

  1. Creating a GitHub issue to track the follow-up work and reference it in the comment
  2. Removing the imports that are no longer used (already done ✓)
  3. Using a feature flag instead to disable tracking if you need to quickly re-enable it

If the tracking won't be re-enabled, remove the commented code entirely to improve maintainability.

Suggested change
// if (!canPlay) {
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNSUPPORTED_MIME_TYPE);
// }

Copilot uses AI. Check for mistakes.

return canPlay;
};
Expand Down Expand Up @@ -136,22 +134,25 @@
const playable = await isVideoPlayable(assetUrl.url);

if (!playable) {
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR);
// ToDo: This needs to be revisited

Check warning on line 137 in src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=wireapp_wire-webapp&issues=AZrgAt7pVOp-QAgK5IDK&open=AZrgAt7pVOp-QAgK5IDK&pullRequest=19829
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent TODO format. The codebase uses "Todo" in the other file (useVideoPlayback.ts:56) but "ToDo" here. Please standardize to one format for consistency.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent comment format: "ToDo" should be "TODO" (standard task marker format).

Copilot uses AI. Check for mistakes.
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR);
setVideoPlaybackError(true);
return;
}

setVideoSrc(assetUrl);
setIsVideoLoaded(true);
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_SUCCESS);
// ToDo: This needs to be revisited

Check warning on line 146 in src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=wireapp_wire-webapp&issues=AZrgAt7pVOp-QAgK5IDL&open=AZrgAt7pVOp-QAgK5IDL&pullRequest=19829
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent TODO format. The codebase uses "Todo" in the other file (useVideoPlayback.ts:56) but "ToDo" here. Please standardize to one format for consistency.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent comment format: "ToDo" should be "TODO" (standard task marker format).

Copilot uses AI. Check for mistakes.
//amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_SUCCESS);
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after // in comment. For consistency with other comments in this file and line 107, add a space: // amplify.publish

Suggested change
//amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_SUCCESS);
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_SUCCESS);

Copilot uses AI. Check for mistakes.
} catch (error) {
if (error instanceof Error) {
if (error.name !== AssetError.CANCEL_ERROR) {
setVideoPlaybackError(true);
}
}
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// ToDo: This needs to be revisited

Check warning on line 154 in src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=wireapp_wire-webapp&issues=AZrgAt7pVOp-QAgK5IDM&open=AZrgAt7pVOp-QAgK5IDM&pullRequest=19829
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent TODO format. The codebase uses "Todo" in the other file (useVideoPlayback.ts:56) but "ToDo" here. Please standardize to one format for consistency.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent comment format: "ToDo" should be "TODO" (standard task marker format).

Copilot uses AI. Check for mistakes.
//amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after // in comment. For consistency with other comments in this file and line 107, add a space: // amplify.publish

Suggested change
//amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);

Copilot uses AI. Check for mistakes.
console.error('Failed to load video asset ', error);
}

Expand Down Expand Up @@ -216,7 +217,8 @@
poster={videoPreview?.url}
onError={event => {
setVideoPlaybackError(true);
amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// ToDo: This needs to be revisited

Check warning on line 220 in src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=wireapp_wire-webapp&issues=AZrgAt7pVOp-QAgK5IDN&open=AZrgAt7pVOp-QAgK5IDN&pullRequest=19829
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent TODO format. The codebase uses "Todo" in the other file (useVideoPlayback.ts:56) but "ToDo" here. Please standardize to one format for consistency.

Suggested change
// ToDo: This needs to be revisited
// Todo: This needs to be revisited

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent comment format: "ToDo" should be "TODO" (standard task marker format).

Suggested change
// ToDo: This needs to be revisited
// TODO: This needs to be revisited

Copilot uses AI. Check for mistakes.
//amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after // in comment. For consistency with other comments in this file and line 107, add a space: // amplify.publish

Suggested change
//amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
// amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);

Copilot uses AI. Check for mistakes.
console.error('Video cannot be played', event);
}}
onPlaying={onVideoPlaying}
Expand Down
Loading