wt-io-it / odoo-pycharm-plugin

Plugin to Support Odoo in Pycharm
GNU Affero General Public License v3.0
19 stars 10 forks source link

getModuleDirectorySlow java.lang.Throwable: Assertion failed #50

Closed SirTakobi closed 2 years ago

SirTakobi commented 2 years ago

Plugin Version: 0.5.16 IDEA Version: PyCharm 2022.2.1

java.lang.Throwable: Assertion failed ``` java.lang.Throwable: Assertion failed at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:220) ... at com.intellij.psi.search.FilenameIndex.getFilesByName(FilenameIndex.java:79) at at.wtioit.intellij.plugins.odoo.modules.impl.OdooModuleServiceImpl.lambda$getModuleDirectorySlow$3(OdooModuleServiceImpl.java:136) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:928) at at.wtioit.intellij.plugins.odoo.modules.impl.OdooModuleServiceImpl.getModuleDirectorySlow(OdooModuleServiceImpl.java:134) at at.wtioit.intellij.plugins.odoo.modules.impl.OdooModuleServiceImpl.getModuleDirectory(OdooModuleServiceImpl.java:129) at at.wtioit.intellij.plugins.odoo.modules.index.OdooDeserializedModuleImpl.getDirectory(OdooDeserializedModuleImpl.java:64) at at.wtioit.intellij.plugins.odoo.WithinProject.call(WithinProject.java:15) at at.wtioit.intellij.plugins.odoo.pycharm.PyCharmOdooAddonsImportResolver.resolveImportReference(PyCharmOdooAddonsImportResolver.java:38) at at.wtioit.intellij.plugins.odoo.pycharm.PyCharmOdooAddonsImportResolver.resolveImportReference(PyCharmOdooAddonsImportResolver.java:42) at com.jetbrains.python.psi.resolve.PyResolveImportUtil$foreignResults$1.invoke(PyResolveImportUtil.kt:199) ... at java.base/java.lang.Thread.run(Thread.java:833) ```

Seems to me exactly the same as https://github.com/wt-io-it/odoo-pycharm-plugin/issues/46

ap-wtioit commented 2 years ago

@SirTakobi thanks for reporting this. Unfortunately because it's currently happening in a not reproducible manner, i currently can not imagine a proper fix for this.

I guess it also happened only once on your system? Also it seems not an issue with (only) our plugin as other plugins experience the same errors: https://youtrack.jetbrains.com/issue/IDEA-291382/Assertion-failed-at-VirtualDirectoryImpldoFindChildById

JetBrains has no activity (visible to me) on the issues for their plugins/tests, so until i can figure out how to test for this i cannot promise any working fix for this.

If it happened more than once on anybodies system that would be highly valuable info.

SirTakobi commented 2 years ago

yes it's the same as all the others, basically #33, i think i figured a way to reproduce it while investigating the other issues (Read access is allowed from inside read-action, not related to this):

  • open a file with a from odoo.addons. import (excluding base)
  • CTRL click anything in the import that is not odoo or odoo.addons
  • select invalidate caches from the file menu
  • restart the IDE
  • while indexing is still in progress
  • CTRL click the same stuff again until it no longer says Cannot find declaration to go to

will continue in #33

Originally posted by @ap-wtioit in https://github.com/wt-io-it/odoo-pycharm-plugin/issues/51#issuecomment-1246403252

ap-wtioit commented 2 years ago

fixed with https://github.com/wt-io-it/odoo-pycharm-plugin/issues/33 (620508fc55b16691df8772f3239f21fd4f06be56 and 9be48e2c3afc109a75a290b1a34017d18f2579f7, 0.5.18)