Merge branch 'sentry-fixes' into 'develop'

Sentry fixes

See merge request soapbox-pub/soapbox-fe!1548
This commit is contained in:
Alex Gleason 2022-06-20 18:19:56 +00:00
commit ff903e0d2b
5 changed files with 63 additions and 69 deletions

View file

@ -38,7 +38,7 @@ function showAlert(
}
const showAlertForError = (error: AxiosError<any>) => (dispatch: React.Dispatch<AnyAction>, _getState: any) => {
if (error.response) {
if (error?.response) {
const { data, status, statusText } = error.response;
if (status === 502) {
@ -52,7 +52,7 @@ const showAlertForError = (error: AxiosError<any>) => (dispatch: React.Dispatch<
let message: string | undefined = statusText;
if (data.error) {
if (data?.error) {
message = data.error;
}

View file

@ -229,9 +229,6 @@ export const logIn = (username: string, password: string) =>
throw error;
});
export const deleteSession = () =>
(dispatch: AppDispatch, getState: () => any) => api(getState).delete('/api/sign_out');
export const logOut = () =>
(dispatch: AppDispatch, getState: () => RootState) => {
const state = getState();
@ -246,10 +243,7 @@ export const logOut = () =>
token: state.auth.getIn(['users', account.url, 'access_token']),
};
return Promise.all([
dispatch(revokeOAuthToken(params)),
dispatch(deleteSession()),
]).finally(() => {
return dispatch(revokeOAuthToken(params)).finally(() => {
dispatch({ type: AUTH_LOGGED_OUT, account, standalone });
return dispatch(snackbar.success(messages.loggedOut));
});

View file

@ -11,10 +11,22 @@ export const useSystemTheme = (): SystemTheme => {
setDark(event.matches);
};
// Older versions of Safari on iOS don't support these events,
// so try-catch and do nothing.
useEffect(() => {
try {
query.addEventListener('change', handleChange);
} catch (e) {
// do nothing
}
return () => query.removeEventListener('change', handleChange);
return () => {
try {
query.removeEventListener('change', handleChange);
} catch (e) {
// do nothing
}
};
}, []);
return dark ? 'dark' : 'light';

View file

@ -64,9 +64,9 @@
"@reach/tabs": "^0.16.4",
"@reach/tooltip": "^0.16.2",
"@reduxjs/toolkit": "^1.8.1",
"@sentry/browser": "^6.12.0",
"@sentry/react": "^6.12.0",
"@sentry/tracing": "^6.12.0",
"@sentry/browser": "^7.2.0",
"@sentry/react": "^7.2.0",
"@sentry/tracing": "^7.2.0",
"@tabler/icons": "^1.53.0",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/typography": "^0.5.1",

View file

@ -2138,79 +2138,67 @@
redux-thunk "^2.4.1"
reselect "^4.1.5"
"@sentry/browser@6.12.0", "@sentry/browser@^6.12.0":
version "6.12.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.12.0.tgz#970cd68fa117a1e1336fdb373e3b1fa76cd63e2d"
integrity sha512-wsJi1NLOmfwtPNYxEC50dpDcVY7sdYckzwfqz1/zHrede1mtxpqSw+7iP4bHADOJXuF+ObYYTHND0v38GSXznQ==
"@sentry/browser@7.2.0", "@sentry/browser@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.2.0.tgz#ecfd13c6557ece5f00827109dd577d8d153a89c9"
integrity sha512-QMdRpK7MM8woFOeMTDh7/sXG4lXutgZ/K9SBBMvd5MVaaQnSSE5ZGJMaxMfsiYOISV0UqS7l0V0EaGnv9n3zrQ==
dependencies:
"@sentry/core" "6.12.0"
"@sentry/types" "6.12.0"
"@sentry/utils" "6.12.0"
"@sentry/core" "7.2.0"
"@sentry/types" "7.2.0"
"@sentry/utils" "7.2.0"
tslib "^1.9.3"
"@sentry/core@6.12.0":
version "6.12.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.12.0.tgz#bc7c5f0785b6a392d9ad47bd9b1fae3f5389996c"
integrity sha512-mU/zdjlzFHzdXDZCPZm8OeCw7c9xsbL49Mq0TrY0KJjLt4CJBkiq5SDTGfRsenBLgTedYhe5Z/J8Z+xVVq+MfQ==
"@sentry/core@7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.2.0.tgz#bd6ef331c64ff917cb0ad8a8666b2c4c5c52acdb"
integrity sha512-9amsbB9/ePkJRgc0cVXCVW2hQUPImgTqBbnKu4frBXBza+9MBC5W3S8ZyZt2InCK22kuhNVo3z61a8mzCgXoCA==
dependencies:
"@sentry/hub" "6.12.0"
"@sentry/minimal" "6.12.0"
"@sentry/types" "6.12.0"
"@sentry/utils" "6.12.0"
"@sentry/hub" "7.2.0"
"@sentry/types" "7.2.0"
"@sentry/utils" "7.2.0"
tslib "^1.9.3"
"@sentry/hub@6.12.0":
version "6.12.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.12.0.tgz#29e323ab6a95e178fb14fffb684aa0e09707197f"
integrity sha512-yR/UQVU+ukr42bSYpeqvb989SowIXlKBanU0cqLFDmv5LPCnaQB8PGeXwJAwWhQgx44PARhmB82S6Xor8gYNxg==
"@sentry/hub@7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.2.0.tgz#c19ce0394c7c87647be284fca304d6fa1821ad75"
integrity sha512-uzd+GzD++Z4QopRh3AyRc4jz4AzomMnrXTOmdXgud1BH/Du9AYutVlBc5ZYwqCuJH7QPuAW3ySU3P+16UCinIg==
dependencies:
"@sentry/types" "6.12.0"
"@sentry/utils" "6.12.0"
"@sentry/types" "7.2.0"
"@sentry/utils" "7.2.0"
tslib "^1.9.3"
"@sentry/minimal@6.12.0":
version "6.12.0"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.12.0.tgz#cbe20e95056cedb9709d7d5b2119ef95206a9f8c"
integrity sha512-r3C54Q1KN+xIqUvcgX9DlcoWE7ezWvFk2pSu1Ojx9De81hVqR9u5T3sdSAP2Xma+um0zr6coOtDJG4WtYlOtsw==
"@sentry/react@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.2.0.tgz#5600bdadc970044c1a98e69ad815711429dc679b"
integrity sha512-4QtOaxTWRomL4qwa5X5UR4cM3XnDNtumBu0Lua5d7xV93/1m44hWvdxB4sqf/ueL6dPqmg0YbtgDYzT3loE5vQ==
dependencies:
"@sentry/hub" "6.12.0"
"@sentry/types" "6.12.0"
tslib "^1.9.3"
"@sentry/react@^6.12.0":
version "6.12.0"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-6.12.0.tgz#8ae2680d226fafb0da0f3d8366bb285004ba6c2e"
integrity sha512-E8Nw9PPzP/EyMy64ksr9xcyYYlBmUA5ROnkPQp7o5wF0xf5/J+nMS1tQdyPnLQe2KUgHlN4kVs2HHft1m7mSYQ==
dependencies:
"@sentry/browser" "6.12.0"
"@sentry/minimal" "6.12.0"
"@sentry/types" "6.12.0"
"@sentry/utils" "6.12.0"
"@sentry/browser" "7.2.0"
"@sentry/types" "7.2.0"
"@sentry/utils" "7.2.0"
hoist-non-react-statics "^3.3.2"
tslib "^1.9.3"
"@sentry/tracing@^6.12.0":
version "6.12.0"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.12.0.tgz#a05c8985ee7fed7310b029b147d8f9f14f2a2e67"
integrity sha512-u10QHNknPBzbWSUUNMkvuH53sQd5NaBo6YdNPj4p5b7sE7445Sh0PwBpRbY3ZiUUiwyxV59fx9UQ4yVnPGxZQA==
"@sentry/tracing@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.2.0.tgz#606350e647d14f946764bed7606ec818d1a87cd5"
integrity sha512-Lw5Y5H/kiesTviISFOtnAhjF7+cMX3MnkzdMl5ANwe5lNFPw/php5olzU9hGUqheKeGyYp3sM8BF4GwegGMWQw==
dependencies:
"@sentry/hub" "6.12.0"
"@sentry/minimal" "6.12.0"
"@sentry/types" "6.12.0"
"@sentry/utils" "6.12.0"
"@sentry/hub" "7.2.0"
"@sentry/types" "7.2.0"
"@sentry/utils" "7.2.0"
tslib "^1.9.3"
"@sentry/types@6.12.0":
version "6.12.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.12.0.tgz#b7395688a79403c6df8d8bb8d81deb8222519853"
integrity sha512-urtgLzE4EDMAYQHYdkgC0Ei9QvLajodK1ntg71bGn0Pm84QUpaqpPDfHRU+i6jLeteyC7kWwa5O5W1m/jrjGXA==
"@sentry/types@7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.2.0.tgz#0c20073956bb46bdea3288683aeba2d5c350deb8"
integrity sha512-e6w62C2AmE5ULr9w/BuVaKTRpKUMGWyw4PhcBlSdDRoS47QgURGgDFIvr3VlaDwkUfCbASwSv49fDhKRX3aoew==
"@sentry/utils@6.12.0":
version "6.12.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.12.0.tgz#3de261e8d11bdfdc7add64a3065d43517802e975"
integrity sha512-oRHQ7TH5TSsJqoP9Gqq25Jvn9LKexXfAh/OoKwjMhYCGKGhqpDNUIZVgl9DWsGw5A5N5xnQyLOxDfyRV5RshdA==
"@sentry/utils@7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.2.0.tgz#b288c204224a9fb1d576323c5168735ec8c03cd5"
integrity sha512-uUKIsIXyb6ZXBbl/L8UwG4gy8PBXZl5pGCUFRPbns+vi0U6vtmDRDYa1A/7E17VkBJNRPVNJQr9Pq5Yd0I0MRA==
dependencies:
"@sentry/types" "6.12.0"
"@sentry/types" "7.2.0"
tslib "^1.9.3"
"@sinclair/typebox@^0.23.3":