Skip to content

Commit a896732

Browse files
johnny/VIDSOL-211-advances-stable-but-integration erros
- removing noise - adding scripts to debug locally johnny/VIDSOL-211-advances johnny/VIDSOL-211-revert camera/mic buttons changes revert to later cause it breaks a lot of integration tests johnny/VIDSOL-211-linter configurations and cleanups johnny/VIDSOL-211-fixing infinite loop of retries on publish johnny/VIDSOL-211-refinements and unit test johnny/VIDSOL-211-removing opera johnny/VIDSOL-211-Handle-permissions-if-user-disablesEnables-cameraMic
1 parent ebb7a48 commit a896732

File tree

120 files changed

+2177
-1184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+2177
-1184
lines changed

.github/ISSUE_TEMPLATE/1-bug-report.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ body:
4646
- Chrome
4747
- Firefox
4848
- Microsoft Edge
49-
- Opera
5049
- Safari
5150
- Electron
5251

.github/workflows/run-tests.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,6 @@ jobs:
7474
/opt/firefox/firefox --version
7575
echo "Firefox latest downloaded and installed"
7676
77-
- name: Install opera latest
78-
run: |
79-
sudo mkdir -p /etc/apt/keyrings
80-
curl -fsSL https://deb.opera.com/archive.key | gpg --dearmor | sudo tee /etc/apt/keyrings/opera.gpg > /dev/null
81-
echo "deb [signed-by=/etc/apt/keyrings/opera.gpg] https://deb.opera.com/opera-stable/ stable non-free" | \
82-
sudo tee /etc/apt/sources.list.d/opera-stable.list > /dev/null
83-
sudo apt-get update
84-
sudo apt-get install opera-stable -y
85-
echo "Check opera version"
86-
/usr/bin/opera --version
87-
8877
- name: Setup node
8978
if: steps.check-skip-ci.outputs.result == 'false'
9079
uses: actions/setup-node@v4

.github/workflows/update-screenshots.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ jobs:
7272
echo "Check firefox version"
7373
/opt/firefox/firefox --version
7474
echo "Firefox latest downloaded and installed"
75-
- name: install opera latest
76-
if: steps.check-update-screenshots.outputs.result == 'true'
77-
run: |
78-
sudo add-apt-repository 'deb https://deb.opera.com/opera-stable/ stable non-free'
79-
wget -qO- https://deb.opera.com/archive.key | sudo apt-key add -
80-
sudo apt-get update
81-
sudo apt-get install opera-stable -y
82-
echo "Check opera version"
83-
/usr/bin/opera --version
84-
echo "Opera latest downloaded and installed"
8575
8676
- name: Checkout
8777
if: steps.check-update-screenshots.outputs.result == 'true'

backend/eslint.config.mjs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ import globals from 'globals';
22
import baseConfig from '../eslint.config.mjs';
33

44
export default [
5-
{
6-
...baseConfig,
7-
8-
files: ['**/*.{ts,tsx,js,jsx}'],
9-
languageOptions: {
10-
globals: globals.node,
11-
},
12-
},
5+
...baseConfig,
6+
{ files: ['**/*.{ts,tsx,js,jsx}'], languageOptions: { globals: globals.node } },
7+
{ files: ['**/*.test.{ts,tsx,js,jsx}'], rules: { '@typescript-eslint/await-thenable': 'off' } },
138
];

backend/project.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
},
1515
"start": {
1616
"executor": "nx:run-commands",
17-
"options": {
18-
"cwd": "backend",
19-
"command": "node --import tsx index.ts"
20-
}
17+
"options": { "cwd": "backend", "command": "node --import tsx index.ts" }
2118
},
2219
"debug": {
2320
"executor": "nx:run-commands",
@@ -48,10 +45,14 @@
4845
"inputs": ["default", "^default", { "externalDependencies": ["jest", "ts-jest"] }]
4946
},
5047
"ts-check": {
48+
"executor": "nx:run-commands",
49+
"options": { "cwd": "backend", "command": "tsc -p tsconfig.json --pretty true --noEmit" }
50+
},
51+
"lint": {
5152
"executor": "nx:run-commands",
5253
"options": {
5354
"cwd": "backend",
54-
"command": "tsc --noEmit -p tsconfig.json --pretty true"
55+
"command": "eslint \"**/*.{ts,tsx,js,jsx}\" --report-unused-disable-directives --max-warnings 0"
5556
}
5657
}
5758
},

backend/routes/session.ts

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,15 @@ import createGetOrCreateSession from './getOrCreateSession';
77
const sessionRouter = Router();
88
const videoService = createVideoService();
99
const sessionService = getSessionStorageService();
10-
const getOrCreateSession = createGetOrCreateSession({
11-
videoService,
12-
sessionService,
13-
});
10+
const getOrCreateSession = createGetOrCreateSession({ videoService, sessionService });
1411

1512
sessionRouter.get('/:room', async (req: Request<{ room: string }>, res: Response) => {
1613
try {
1714
const { room: roomName } = req.params;
1815
const sessionId = await getOrCreateSession(roomName);
1916
const data = videoService.generateToken(sessionId);
2017
const captionsId = await sessionService.getCaptionsId(roomName);
21-
res.json({
22-
sessionId,
23-
token: data.token,
24-
apiKey: data.apiKey,
25-
captionsId,
26-
});
18+
res.json({ sessionId, token: data.token, apiKey: data.apiKey, captionsId });
2719
} catch (error: unknown) {
2820
const message = error instanceof Error ? error.message : error;
2921
res.status(500).send({ message });
@@ -36,15 +28,12 @@ sessionRouter.post('/:room/startArchive', async (req: Request<{ room: string }>,
3628
const sessionId = await sessionService.getSession(roomName);
3729
if (sessionId) {
3830
const archive = await videoService.startArchive(roomName, sessionId);
39-
res.json({
40-
archiveId: archive.id,
41-
status: 200,
42-
});
31+
res.json({ archiveId: archive.id, status: 200 });
4332
} else {
4433
res.status(404).json({ message: 'Room not found' });
4534
}
4635
} catch (error: unknown) {
47-
console.log(error);
36+
console.error(error);
4837
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
4938
res.status(500).json({ message: errorMessage });
5039
}
@@ -57,10 +46,7 @@ sessionRouter.post(
5746
const { archiveId } = req.params;
5847
if (archiveId) {
5948
const responseArchiveId = await videoService.stopArchive(archiveId);
60-
res.json({
61-
archiveId: responseArchiveId,
62-
status: 200,
63-
});
49+
res.json({ archiveId: responseArchiveId, status: 200 });
6450
}
6551
} catch (error: unknown) {
6652
res.status(500).send({ message: (error as Error).message ?? error });
@@ -74,10 +60,7 @@ sessionRouter.get('/:room/archives', async (req: Request<{ room: string }>, res:
7460
const sessionId = await sessionService.getSession(roomName);
7561
if (sessionId) {
7662
const archives = await videoService.listArchives(sessionId);
77-
res.json({
78-
archives,
79-
status: 200,
80-
});
63+
res.json({ archives, status: 200 });
8164
} else {
8265
res.status(404).json({ message: 'Room not found' });
8366
}
@@ -109,10 +92,7 @@ sessionRouter.post(
10992
} else {
11093
// the captions were already enabled for this room
11194
const captionsId = await sessionService.getCaptionsId(roomName);
112-
res.json({
113-
captionsId,
114-
status: 200,
115-
});
95+
res.json({ captionsId, status: 200 });
11696
}
11797
} catch (error: unknown) {
11898
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
@@ -148,15 +128,9 @@ sessionRouter.post(
148128
if (captionsUserCount === 0) {
149129
const disableResponse = await videoService.disableCaptions(captionsId);
150130
await sessionService.setCaptionsId(roomName, '');
151-
res.json({
152-
disableResponse,
153-
status: 200,
154-
});
131+
res.json({ disableResponse, status: 200 });
155132
} else {
156-
res.json({
157-
disableResponse: 'Captions are still active for other users',
158-
status: 200,
159-
});
133+
res.json({ disableResponse: 'Captions are still active for other users', status: 200 });
160134
}
161135
} catch (error: unknown) {
162136
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';

backend/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ app.get('/*', (_req: Request, res: Response) => {
3434
const startServer: () => Promise<Server> = () => {
3535
return new Promise((res) => {
3636
const server: Server = app.listen(port, () => {
37-
console.log('Server listening on port', port);
37+
console.info('Server listening on port', port);
3838
res(server);
3939
});
4040
});

backend/services/jiraFeedbackService.ts

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,18 @@ class JiraFeedbackService implements FeedbackService {
3333
async reportIssue(data: FeedbackData): Promise<ReportIssueReturn | null> {
3434
const feedbackIssueData = {
3535
fields: {
36-
project: {
37-
key: this.jiraKey,
38-
},
36+
project: { key: this.jiraKey },
3937
summary: data.title,
4038
description: `Reported by: ${data.name}\n\n Issue description:\n${data.issue}`,
41-
issuetype: {
42-
name: 'Bug',
43-
},
44-
components: [
45-
{
46-
id: this.getComponentIdByOrigin(data.origin),
47-
},
48-
],
39+
issuetype: { name: 'Bug' },
40+
components: [{ id: this.getComponentIdByOrigin(data.origin) }],
4941
[this.jiraEpicLink]: this.jiraEpicUrl,
5042
},
5143
};
5244

5345
try {
54-
const response = await axios.post(this.jiraApiUrl, feedbackIssueData, {
55-
headers: {
56-
'Content-Type': 'application/json',
57-
Authorization: `Basic ${this.jiraToken}`,
58-
},
46+
const response = await axios.post<{ key: string }>(this.jiraApiUrl, feedbackIssueData, {
47+
headers: { 'Content-Type': 'application/json', Authorization: `Basic ${this.jiraToken}` },
5948
});
6049

6150
const ticketData: ReportIssueReturn = {
@@ -68,7 +57,7 @@ class JiraFeedbackService implements FeedbackService {
6857
}
6958
return await this.addAttachment(data.attachment, ticketData, response.data.key);
7059
} catch (error) {
71-
console.log('Response Error:', error);
60+
console.error('Response Error:', error);
7261
return null;
7362
}
7463
}
@@ -80,10 +69,7 @@ class JiraFeedbackService implements FeedbackService {
8069
): Promise<ReportIssueReturn> {
8170
const fileBuffer = Buffer.from(attachment, 'base64');
8271
const formData = new FormData();
83-
formData.append('file', fileBuffer, {
84-
filename: 'screenshot.png',
85-
contentType: 'image/png',
86-
});
72+
formData.append('file', fileBuffer, { filename: 'screenshot.png', contentType: 'image/png' });
8773

8874
await axios.post(`${this.jiraApiUrl}${key}/attachments`, formData, {
8975
headers: {
@@ -94,10 +80,7 @@ class JiraFeedbackService implements FeedbackService {
9480
},
9581
});
9682

97-
return {
98-
...ticketData,
99-
screenshotIncluded: true,
100-
};
83+
return { ...ticketData, screenshotIncluded: true };
10184
}
10285

10386
private getComponentIdByOrigin(origin: FeedbackOrigin): string {

backend/storage/inMemorySessionStorage.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// [TODO]: Fix require-await linting issue
2+
/* eslint-disable @typescript-eslint/require-await */
13
import { SessionStorage } from './sessionStorage';
24

35
interface SessionData {
@@ -14,11 +16,7 @@ class InMemorySessionStorage implements SessionStorage {
1416
}
1517

1618
async setSession(roomName: string, sessionId: string): Promise<void> {
17-
this.sessions[roomName] = {
18-
sessionId,
19-
captionsId: null,
20-
captionsUserCount: 0,
21-
};
19+
this.sessions[roomName] = { sessionId, captionsId: null, captionsUserCount: 0 };
2220
}
2321

2422
async setCaptionsId(roomName: string, captionsId: string): Promise<void> {

backend/storage/tests/inMemorySessionStorage.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ describe('InMemorySessionStorage', () => {
8989
await storage.setSession(room, 'session123');
9090
await storage.incrementCaptionsUserCount(room);
9191
for (let i = 0; i < 5; i++) {
92-
// eslint-disable-next-line no-await-in-loop
9392
const count = await storage.decrementCaptionsUserCount(room);
9493
expect(count).toBe(0);
9594
}

0 commit comments

Comments
 (0)