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
2 changes: 2 additions & 0 deletions server/channels/api4/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ func postLog(c *Context, w http.ResponseWriter, r *http.Request) {
fields := []mlog.Field{
mlog.String("type", "client_message"),
mlog.String("user_agent", c.AppContext.UserAgent()),
mlog.String("session_id", c.AppContext.Session().Id),
mlog.String("user_id", c.AppContext.Session().UserId),
}

if !forceToDebug && lvl == "ERROR" {
Expand Down
19 changes: 18 additions & 1 deletion webapp/channels/src/components/root/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import type {History} from 'history';

import {LogLevel} from '@mattermost/types/client4';
import type {ServerError} from '@mattermost/types/errors';
import type {UserProfile} from '@mattermost/types/users';

Expand All @@ -25,7 +26,7 @@ import {reloadPage} from 'utils/browser_utils';
import {StoragePrefixes} from 'utils/constants';
import {doesCookieContainsMMUserId} from 'utils/utils';

import type {ThunkActionFunc} from 'types/store';
import type {ActionFuncAsync, ThunkActionFunc} from 'types/store';
import type {Translations} from 'types/store/i18n';

export type TranslationPluginFunction = (locale: string) => Translations
Expand Down Expand Up @@ -156,3 +157,19 @@ export function handleLoginLogoutSignal(e: StorageEvent): ThunkActionFunc<void>
}
};
}

export function logIfConcurrentReactEnabled(): ActionFuncAsync<boolean> {
return async () => {
const concurrentReactEnabled = localStorage.getItem('enable_concurrent_react_experimental') === 'true';

if (concurrentReactEnabled) {
Client4.logClientError(
"This user's session is using experimental concurrent React which may cause visual bugs. It can be " +
'disabled from Settings > Advanced or by clearing their browser storage.',
LogLevel.Debug,
);
}

return {data: concurrentReactEnabled};
};
}
2 changes: 2 additions & 0 deletions webapp/channels/src/components/root/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
loadConfigAndMe,
handleLoginLogoutSignal,
redirectToOnboardingOrDefaultTeam,
logIfConcurrentReactEnabled,
} from './actions';
import Root from './root';

Expand Down Expand Up @@ -77,6 +78,7 @@ function mapDispatchToProps(dispatch: Dispatch) {
actions: bindActionCreators({
loadConfigAndMe,
loadRecentlyUsedCustomEmojis,
logIfConcurrentReactEnabled,
migrateRecentEmojis,
initializeProducts,
handleLoginLogoutSignal,
Expand Down
1 change: 1 addition & 0 deletions webapp/channels/src/components/root/root.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('components/Root', () => {
});
}),
loadRecentlyUsedCustomEmojis: jest.fn(),
logIfConcurrentReactEnabled: jest.fn(),
migrateRecentEmojis: jest.fn(),
initializeProducts: jest.fn(),
...bindActionCreators({
Expand Down
2 changes: 2 additions & 0 deletions webapp/channels/src/components/root/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ export default class Root extends React.PureComponent<Props, State> {
initiateMeRequests = async () => {
const {isLoaded, isMeRequested} = await this.props.actions.loadConfigAndMe();

this.props.actions.logIfConcurrentReactEnabled();

if (isLoaded) {
const isUserAtRootRoute = this.props.location.pathname === '/';

Expand Down
Loading