Skip to content

fix: import unlock_options in ui_panels - panel Unlock button raised NameError [Better data collection] - #2302

Open
PetrDlouhy wants to merge 1 commit into
mainfrom
claude/fix-unlock-options-import
Open

fix: import unlock_options in ui_panels - panel Unlock button raised NameError [Better data collection]#2302
PetrDlouhy wants to merge 1 commit into
mainfrom
claude/fix-unlock-options-import

Conversation

@PetrDlouhy

Copy link
Copy Markdown
Contributor

Production bug — the detail panel's Unlock button

#2245 made the locked-asset detail panel call unlock_options.get_unlock_variant() (ui_panels.py:3807) but never imported unlock_options into ui_panels. Drawing that branch raises NameError, so the "Unlock" button is missing for every user who cannot download the asset — the panel-side conversion path. Verified in the released tag v3.21.2.260907 (in wide distribution since 2026-09-07 per telemetry).

The drag-and-drop upsell dialog is unaffected: asset_bar/asset_drag_op.py imports the module.

Nobody saw it because no test draws that panel branch and add-on draw errors don't reach Sentry. It surfaced through a test in #2301 that patches ui_panels.unlock_options.

Fix

One import line, plus a test that pins the module attribute so the reference cannot silently dangle again.

Note for #2296/#2301: #2301 carries the same line; a trivial same-line conflict on rebase.

🤖 Generated with Claude Code

…sed NameError

#2245 made the locked-asset detail panel call
unlock_options.get_unlock_variant() but never imported the module into
ui_panels, so drawing that branch raises NameError and the Unlock button
is missing for every user who cannot download the asset. Released in
v3.21.2.260907. The drag-and-drop dialog was unaffected (asset_drag_op
imports the module).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@PetrDlouhy PetrDlouhy self-assigned this Sep 11, 2026
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 33.23%. Comparing base (9d7756e) to head (142eb9c).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2302   +/-   ##
=======================================
  Coverage   33.22%   33.23%           
=======================================
  Files          86       86           
  Lines       27246    27250    +4     
=======================================
+ Hits         9053     9057    +4     
  Misses      18193    18193           
Flag Coverage Δ
python 33.23% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tests/test_ui_panels.py 97.89% <100.00%> (+0.03%) ⬆️
ui_panels.py 23.32% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 this pull request may close these issues.

1 participant