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

App crashes when opening some screens directly from a URL #79

Closed
zecakeh opened this issue Jan 3, 2021 · 4 comments · Fixed by #99
Closed

App crashes when opening some screens directly from a URL #79

zecakeh opened this issue Jan 3, 2021 · 4 comments · Fixed by #99

Comments

@zecakeh
Copy link
Contributor

zecakeh commented Jan 3, 2021

This happens on web (obviously) in several screens. I found two for now. This happens on URLs that work when navigating the app.

We get the message Unhandled Rejection (TypeError): can't access property "getCollectionManager", etebase is undefined.

  • In CollectionMembersScreen with this stack:
Uncaught (in promise) TypeError: can't access property "getCollectionManager", etebase is undefined
    fetchMembers$ Ember
    tryCatch runtime.js:63
    invoke runtime.js:293
    defineIteratorMethods runtime.js:118
    tryCatch runtime.js:63
    invoke runtime.js:154
    callInvokeWithMethodAndArg runtime.js:189
    callInvokeWithMethodAndArg runtime.js:188
    enqueue runtime.js:211
    defineIteratorMethods runtime.js:118
    async runtime.js:238
    Ember 2
    React 6
    unstable_runWithPriority scheduler.development.js:653
    React 4
    unstable_runWithPriority scheduler.development.js:653
    React 6
    PortalManager PortalManager.tsx:20
    PortalHost PortalHost.tsx:78
    componentDidMount$ PortalConsumer.tsx:16
    tryCatch runtime.js:63
    invoke runtime.js:293
    defineIteratorMethods runtime.js:118
    tryCatch runtime.js:63
    invoke runtime.js:154
    invoke runtime.js:164
  • In ItemEditScreen with this stack:
Uncaught (in promise) TypeError: can't access property "getCollectionManager", etebase is undefined
    _callee$ ItemEditScreen.tsx:93
    tryCatch runtime.js:63
    invoke runtime.js:293
    defineIteratorMethods runtime.js:118
    tryCatch runtime.js:63
    invoke runtime.js:154
    callInvokeWithMethodAndArg runtime.js:189
    callInvokeWithMethodAndArg runtime.js:188
    enqueue runtime.js:211
    defineIteratorMethods runtime.js:118
    async runtime.js:238
    _callee ItemEditScreen.tsx:92
    ItemEditScreen ItemEditScreen.tsx:92
    React 6
    unstable_runWithPriority scheduler.development.js:653
    React 4
    unstable_runWithPriority scheduler.development.js:653
    React 6
    PortalManager PortalManager.tsx:20
    PortalHost PortalHost.tsx:78
    componentDidMount$ PortalConsumer.tsx:16
    tryCatch runtime.js:63
    invoke runtime.js:293
    defineIteratorMethods runtime.js:118
    tryCatch runtime.js:63
    invoke runtime.js:154
    invoke runtime.js:164
    promise callback*invoke runtime.js:163
    callInvokeWithMethodAndArg runtime.js:189
    callInvokeWithMethodAndArg runtime.js:188
    enqueue runtime.js:211
    defineIteratorMethods runtime.js:118
    async runtime.js:238
    componentDidMount bundle.js:118533
    React 6
    unstable_runWithPriority scheduler.development.js:653
    React 5
    unstable_runWithPriority scheduler.development.js:653
    React 7
    Redux 9
    promiseMiddleware promise-middleware.ts:22
    Redux 2
    MyPersistGate Index.tsx:19
    promise callback*MyPersistGate/< Index.tsx:17
    React 6
    unstable_runWithPriority scheduler.development.js:653
    React 3
    workLoop scheduler.development.js:597
    flushWork scheduler.development.js:552
    performWorkUntilDeadline scheduler.development.js:164
    js scheduler.development.js:187
    js scheduler.development.js:857
    Webpack 25
@zecakeh
Copy link
Contributor Author

zecakeh commented Jan 3, 2021

Is it this piece of code that comes too late maybe:

if (syncGate) {
  return syncGate;
}

I noticed it's called before etebase on some screens that don't have this issue and one of is features is waiting for etebase to be set.

@tasn
Copy link
Member

tasn commented Jan 3, 2021

Could you show examples of this kind of screens? The thing is, react hooks should always all be called, so if there's anywhere where this is called before a hook, it's actually wrong, and I'm surprised it even works.

@zecakeh
Copy link
Contributor Author

zecakeh commented Jan 3, 2021

Actually I didn't explain well. The hooks escape with this (in CollectionEditScreen for example):

if (syncGate) {
  return;
}

@tasn
Copy link
Member

tasn commented Jan 3, 2021

Ah yeah, that makes sense. The screens that don't have it just assume they could never be accessed directly (obviously wrong now with linking), and that's the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants