talonvoice / talon

Issue Tracker for the main Talon app
85 stars 0 forks source link

ResourceClosed error with invalid scope match replaced by valid one #323

Closed nriley closed 3 years ago

nriley commented 3 years ago

I had a script that looks like this:

mod = Module()

mod.apps.citrix_viewer = """
os: mac
and app.bundle: com.citrix.receiver.icaviewer.mac
or app.bundle: com.citrix.XenAppViewer
"""

Turns out that syntax doesn't work. But when I replaced it by removing the older app bundle ID, I still get this every time I try to switch apps:

2021-06-05 13:55:20 ERROR cb error topic="scope" cb=<bound method Scope._matches of <talon.scripting.scope.Scope object at 0x111d907c0>>
   28:  lib/python3.9/threading.py:912* # cron thread
   27:  lib/python3.9/threading.py:954* 
   26:  lib/python3.9/threading.py:892* 
   25:               talon/cron.py:145| 
   24:               talon/cron.py:105| 
   23: talon/scripting/dispatch.py:99 | 
   22: talon/scripting/dispatch.py:105| 
   21: talon/scripting/dispatch.py:144| 
   20: talon/scripting/dispatch.py:133| 
   19:     talon/scripting/rctx.py:233| # 'app_deactivate' app:update()
   18:    talon/scripting/scope.py:30 | 
   17: talon/scripting/dispatch.py:105| 
   16: talon/scripting/dispatch.py:144| 
   15: talon/scripting/dispatch.py:135| 
   14:     talon/scripting/rctx.py:233| # 'update' main:update_one()
   13:    talon/scripting/scope.py:134| 
   12: talon/scripting/dispatch.py:105| 
   11: talon/scripting/dispatch.py:144| 
   10: talon/scripting/dispatch.py:135| 
    9:     talon/scripting/rctx.py:233| # 'change' main:_registry_update_contexts()
    8:    talon/scripting/scope.py:55 | 
    7: talon/scripting/registry.py:357| 
    6: talon/scripting/registry.py:333| 
    5:    talon/scripting/types.py:260| 
    4:    talon/scripting/scope.py:93 | 
    3: -------------------------------# cron thread
    2:     talon/scripting/rctx.py:231| # 'scope' user.knausj_talon.apps.mac.citrix.citrix_viewer:_matches()
    1:     talon/scripting/rctx.py:202| 
talon.scripting.rctx.ResourceClosed: ResourceContext("user.knausj_talon.apps.mac.citrix.citrix_viewer") already freed
2021-06-05 13:55:20 ERROR cb error topic="scope" cb=<bound method Scope._matches of <talon.scripting.scope.Scope object at 0x111d907c0>>

The error disappears after I restart Talon.

lunixbochs commented 3 years ago

could be related to https://github.com/talonvoice/talon/issues/322 but it's good to have unique tests for it

lunixbochs commented 3 years ago

I think this is fixed in 0.1.5-486, let me know if you hit it again

nriley commented 3 years ago

Still seeing it in 0.1.5-487.

2021-07-10 14:17:53 ERROR cb error topic="hotkey:cmd-ctrl-l" cb=core.run_hotkey(hotkey: talon.scripting.types.ScriptImpl)
    Run all commands for a hotkey
   10:                 talon/mac/tap.py:141| 
    9:      talon/scripting/dispatch.py:105| 
    8:      talon/scripting/dispatch.py:144| 
    7:      talon/scripting/dispatch.py:135| 
    6:          talon/scripting/rctx.py:233| # 33 main:on_key()
    5: talon/scripting/hotkey_system.py:59 | 
    4: talon/scripting/hotkey_system.py:41 | 
    3: ------------------------------------# 33 main:on_key()
    2:          talon/scripting/rctx.py:231| # 'hotkey:cmd-ctrl-l' user.hyperspace_auth.talon:actions.core.run_hotkey.__name__()
    1:          talon/scripting/rctx.py:202| 
talon.scripting.rctx.ResourceClosed: ResourceContext("user.hyperspace_auth.talon") already freed
lunixbochs commented 3 years ago

That looks like a different issue

nriley commented 3 years ago

OK will file a separate issue. Thanks.