Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/v3.0.x-release' into v3.0.x-re…
Browse files Browse the repository at this point in the history
…lease
  • Loading branch information
antonbsa committed Nov 21, 2024
2 parents deca8c6 + 46fda48 commit 6b42972
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 58 deletions.
2 changes: 1 addition & 1 deletion bigbluebutton-html5/client/meetingClient.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import PLUGIN_CONFIGURATION_QUERY from '/imports/ui/components/plugins-engine/qu
const Startup = () => {
const loadingContextInfo = useContext(LoadingContext);
useEffect(() => {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
}, []);
// Logs all uncaught exceptions to the client logger
window.addEventListener('error', (e) => {
Expand Down
8 changes: 4 additions & 4 deletions bigbluebutton-html5/imports/startup/client/intlLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const IntlLoader: React.FC<IntlLoaderProps> = ({
const foundLocales = typedResp.filter((locale) => locale instanceof Object) as LocaleJson[];
if (foundLocales.length === 0) {
const error = `${{ logCode: 'intl_fetch_locale_error' }},Could not fetch any locale file for ${languageSets.join(', ')}`;
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
logger.error(error);
throw new Error(error);
}
Expand All @@ -137,15 +137,15 @@ const IntlLoader: React.FC<IntlLoaderProps> = ({
setCurrentLocale(replacedLocale);
setMessages(mergedLocale);
if (!init) {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
}
}).catch((error) => {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
throw new Error(error);
});
})
.catch(() => {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
throw new Error('unable to fetch localized messages');
});
}, []);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import React from 'react';
import Styled from './styles';

const LoadingScreen = ({ children }) => (
const LoadingScreen = () => (
<Styled.Background>
<Styled.Spinner animations>
<Styled.Bounce1 animations />
<Styled.Bounce2 animations />
<div />
</Styled.Spinner>
<Styled.Message>
{children}
</Styled.Message>
</Styled.Background>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import LoadingScreen from '../component';

interface LoadingContent {
isLoading: boolean;
loadingMessage: string;
}

interface LoadingContextContent extends LoadingContent {
setLoading: (isLoading: boolean, loadingMessage: string) => void;
setLoading: (isLoading: boolean) => void;
}

export const LoadingContext = React.createContext<LoadingContextContent>({
isLoading: false,
loadingMessage: '',
setLoading: () => { },
});

Expand All @@ -25,27 +23,22 @@ const LoadingScreenHOC: React.FC<LoadingScreenHOCProps> = ({
}) => {
const [loading, setLoading] = React.useState<LoadingContent>({
isLoading: false,
loadingMessage: '',
});

return (
<LoadingContext.Provider value={{
loadingMessage: loading.loadingMessage,
isLoading: loading.isLoading,
setLoading: (isLoading: boolean, loadingMessage: string = '') => {
setLoading: (isLoading: boolean) => {
setLoading({
isLoading,
loadingMessage,
});
},
}}
>
{
loading.isLoading
? (
<LoadingScreen>
<h1>{loading.loadingMessage}</h1>
</LoadingScreen>
<LoadingScreen />
)
: null
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import styled, { css, keyframes } from 'styled-components';
import { mdPaddingX } from '/imports/ui/stylesheets/styled-components/general';
import { loaderBg, loaderBullet, colorWhite } from '/imports/ui/stylesheets/styled-components/palette';
import { fontSizeLarge } from '/imports/ui/stylesheets/styled-components/typography';
import { loaderBg, loaderBullet } from '/imports/ui/stylesheets/styled-components/palette';

const Background = styled.div`
position: fixed;
Expand Down Expand Up @@ -57,16 +56,9 @@ const Bounce2 = styled.div`
`}
`;

const Message = styled.div`
font-size: ${fontSizeLarge};
color: ${colorWhite};
text-align: center;
`;

export default {
Background,
Spinner,
Bounce1,
Bounce2,
Message,
};
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac
BBBWeb.index().then(({ data }) => {
setGraphqlUrl(data.graphqlWebsocketUrl);
}).catch((error) => {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
throw new Error('Error fetching GraphQL URL: '.concat(error.message || ''));
});
logger.info('Fetching GraphQL URL');
loadingContextInfo.setLoading(true, '1/2');
loadingContextInfo.setLoading(true);
}, []);

useEffect(() => {
Expand Down Expand Up @@ -155,12 +155,12 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac

useEffect(() => {
logger.info('Connecting to GraphQL server');
loadingContextInfo.setLoading(true, '2/2');
loadingContextInfo.setLoading(true);
if (graphqlUrl) {
const urlParams = new URLSearchParams(window.location.search);
const sessionToken = urlParams.get('sessionToken');
if (!sessionToken) {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
throw new Error('Missing session token');
}
sessionStorage.setItem('sessionToken', sessionToken);
Expand Down Expand Up @@ -215,7 +215,7 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac
}

if (error && typeof error === 'object' && 'code' in error && error.code === 4403) {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
setTerminalError('Server refused the connection');
return false;
}
Expand All @@ -233,7 +233,7 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac
on: {
error: (error) => {
logger.error('Graphql Client Error:', error);
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
connectionStatus.setConnectedStatus(false);
setErrorCounts((prev: number) => prev + 1);
},
Expand All @@ -259,7 +259,7 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac
// message ID -1 as a signal to terminate the session
// it contains a prop message.messageId which can be used to show a proper error to the user
logger.error({ logCode: 'graphql_server_closed_connection', extraInfo: message }, 'Graphql Server closed the connection');
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
const payload = message.payload as ErrorPayload[];
if (payload[0].messageId) {
setTerminalError(new Error(payload[0].message, { cause: payload[0].messageId }));
Expand All @@ -277,12 +277,12 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac
);
wsLink = ApolloLink.from([payloadSizeCheckLink, errorLink, graphWsLink]);
wsLink.setOnError((error) => {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
throw new Error('Error: on apollo connection'.concat(JSON.stringify(error) || ''));
});
apolloContextHolder.setLink(subscription);
} catch (error) {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
throw new Error('Error creating WebSocketLink: '.concat(JSON.stringify(error) || ''));
}
let client;
Expand All @@ -295,7 +295,7 @@ const ConnectionManager: React.FC<ConnectionManagerProps> = ({ children }): Reac
setApolloClient(client);
apolloContextHolder.setClient(client);
} catch (error) {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
throw new Error('Error creating Apollo Client: '.concat(JSON.stringify(error) || ''));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ const CustomUsersSettings: React.FC<CustomUsersSettingsProps> = ({
/>
) : null}
{loading ? (
<LoadingScreen>
<div className="sr-only">
Loading...
</div>
</LoadingScreen>
<LoadingScreen />
) : null}
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const GuestWait: React.FC<GuestWaitProps> = (props) => {
const sessionToken = getSearchParam('sessionToken');

if (loadingContextInfo.isLoading) {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
}

if (!sessionToken) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const PresenceManager: React.FC<PresenceManagerProps> = ({
useEffect(() => {
if (isGuestAllowed) {
timeoutRef.current = setTimeout(() => {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
throw new Error('Authentication timeout');
}, connectionTimeout);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ const PresenceManager: React.FC<PresenceManagerProps> = ({

useEffect(() => {
if (joinErrorCode) {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
}
},
[joinErrorCode, joinErrorMessage]);
Expand Down Expand Up @@ -204,7 +204,7 @@ const PresenceManagerContainer: React.FC<PresenceManagerContainerProps> = ({ chi
const loadingContextInfo = useContext(LoadingContext);
if (loading || userInfoLoading) return null;
if (error || userInfoError) {
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
logger.debug(`Error on user authentication: ${error}`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({

useEffect(() => {
// Sets Loading to falsed and removes loading splash screen
loadingContextInfo.setLoading(false, '');
loadingContextInfo.setLoading(false);
// Stops all media tracks
window.dispatchEvent(new Event('StopAudioTracks'));
// get the media tag from the session storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ const SettingsLoader: React.FC<SettingsLoaderProps> = (props) => {
/>
) : null}
{loading ? (
<LoadingScreen>
<div style={{ display: 'none' }}>
Loading...
</div>
</LoadingScreen>
<LoadingScreen />
) : null}
</>
);
Expand Down
3 changes: 2 additions & 1 deletion bigbluebutton-tests/playwright/layouts/layouts.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ test.describe('Layout', { tag: '@ci' }, () => {
await layouts.customLayout();
});

test("Update everyone's layout", async () => {
test("Update everyone's layout", { tag: '@flaky' }, async () => {
// snapshot comparison failing due to unexpected zooming slide after layout update
await layouts.updateEveryone();
});
});
3 changes: 2 additions & 1 deletion bigbluebutton-tests/playwright/parameters/parameters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ test.describe.parallel('Custom Parameters', { tag: '@ci' }, () => {
await customParam.hidePresentationOnJoin();
});

test('Force restore presentation on new events', { tag: '@ci' }, async ({ browser, context, page }) => {
test('Force restore presentation on new events', { tag: ['@ci', '@flaky'] }, async ({ browser, context, page }) => {
// tagged as flaky because it's restoring presentation right after minimizing it due to unexpected zooming slide
const customParam = new CustomParameters(browser, context);
await customParam.initModPage(page);
await customParam.initUserPage(true, context, { useModMeetingId: true, joinParameter: c.forceRestorePresentationOnNewEvents });
Expand Down
9 changes: 6 additions & 3 deletions bigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { test } = require('../fixtures');
const { Draw } = require('./draw');
const { DrawRectangle } = require('./drawRectangle');
const { DrawEllipse } = require('./drawEllipse');
const { DrawTriangle } = require('./drawTriangle');
Expand All @@ -10,7 +9,6 @@ const { DrawStickyNote } = require('./drawStickyNote');
const { Pan } = require('./pan');
const { Eraser } = require('./eraser');
const { DrawArrow } = require('./drawArrow');
const { MultiUsers } = require('../user/multiusers');
const { encodeCustomParams } = require('../parameters/util');
const { PARAMETER_HIDE_PRESENTATION_TOAST } = require('../core/constants');
const { DeleteDrawing } = require('./deleteDrawing');
Expand All @@ -22,7 +20,12 @@ const { ShapeOptions } = require('./shapeOptions');

const hidePresentationToast = encodeCustomParams(PARAMETER_HIDE_PRESENTATION_TOAST);

test.describe.parallel('Whiteboard tools', { tag: '@ci' }, () => {
//! @flaky note:
// all whiteboard tests are flagged as flaky due to unexpected zooming slides
// only avoiding those assertions won't be enough as most of the tests are relying only on snapshot comparisons
// so together with the further fix + re-enablement of the tests, they will need to have non-snapshot assertions added as well
// P.S. 1. the failures seems to be noticeable only on the CI
test.describe.parallel('Whiteboard tools', { tag: ['@ci', '@flaky'] }, () => {
test.beforeEach(({ browserName }) => {
test.skip(browserName !== 'chromium',
'Drawing visual regression tests are enabled only for Chromium');
Expand Down

0 comments on commit 6b42972

Please sign in to comment.