Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Interactive templates taking time to load #3150

Closed
wants to merge 1 commit into from
Closed
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: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@emoji-mart/react": "^1.1.1",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@glific/flow-editor": "^1.26.3-14",
"@glific/flow-editor": "^1.26.3-15",
"@lexical/react": "^0.17.1",
"@mui/icons-material": "^6.1.1",
"@mui/material": "^6.1.1",
Expand Down
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@
import { AuthenticatedRoute } from 'routes/AuthenticatedRoute/AuthenticatedRoute';
import { Logout } from 'containers/Auth/Logout/Logout';
import { checkSessionValidity } from 'common/utils';
import axios from 'axios';

const App = () => {
const navigate = useNavigate();
// by default, do not assign any value to assume login or logout
// let's checkAuthStatusService allocate it on useEffect
const [authenticated, setAuthenticated] = useState<any>();
const [drawerOpen, setDrawerOpen] = useState(true);
axios.get('http://localhost:4000/flow-editor/fields?scope=group').then((data) => console.log(data));

useEffect(() => {
const checkAuth = async () => {
const isAccessTokenPresent = getAuthSession('accessToken') !== null;

Check failure on line 28 in src/App.tsx

View workflow job for this annotation

GitHub Actions / CI

src/App.test.tsx > <App /> > it should render <Login /> component by default

TypeError: Cannot read properties of undefined (reading 'then') ❯ App src/App.tsx:28:64 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 28 in src/App.tsx

View workflow job for this annotation

GitHub Actions / CI

src/App.test.tsx > <App /> > it should render <App /> component correctly in unauthenticated mode

TypeError: Cannot read properties of undefined (reading 'then') ❯ App src/App.tsx:28:64 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 28 in src/App.tsx

View workflow job for this annotation

GitHub Actions / CI

src/App.test.tsx > <App /> > it should render <App /> component correctly in authenticated mode

TypeError: Cannot read properties of undefined (reading 'then') ❯ App src/App.tsx:28:64 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 28 in src/App.tsx

View workflow job for this annotation

GitHub Actions / CI

src/App.test.tsx > <App /> > it should renew token and render <App /> component in authenticated mode if token has expired

TypeError: Cannot read properties of undefined (reading 'then') ❯ App src/App.tsx:28:64 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 28 in src/App.tsx

View workflow job for this annotation

GitHub Actions / CI

src/App.test.tsx > <App /> > it should render <Login /> component and try to renew token if session has expired

TypeError: Cannot read properties of undefined (reading 'then') ❯ App src/App.tsx:28:64 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22
const isTokenAlive = checkAuthStatusService();
let isSessionAlive = false;
if (!isAccessTokenPresent) {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,10 @@
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz#81fd50d11e2c32b2d6241470e3185b70c7b30699"
integrity sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==

"@glific/flow-editor@^1.26.3-14":
version "1.26.3-14"
resolved "https://registry.yarnpkg.com/@glific/flow-editor/-/flow-editor-1.26.3-14.tgz#39583fae301398b6176e7b73cd1197d66f0734a7"
integrity sha512-hRcNrflCGTLQeDDcIvQ2Cnu3lOYdd5zeMZX2d0XGbVzk/z9Fbx7yTrH2pgSjXd2A2XgKWw9hs0gB2QtEbanCDA==
"@glific/flow-editor@^1.26.3-15":
version "1.26.3-15"
resolved "https://registry.yarnpkg.com/@glific/flow-editor/-/flow-editor-1.26.3-15.tgz#7f281213fb3348703343a43d8d72fb0a8f3203a6"
integrity sha512-bCDjpodnCr32ZLOgq36HvveSUXL5NibEjJ2qwnvIBeyROipHvTLFlS4zpyU7JIB+rK6SDXlgVLcWmSveNK228w==
dependencies:
react "^16.8.6"
react-dom "^16.8.6"
Expand Down
Loading