Skip to content

Parameter value setters report success after swallowing failures #313

Description

@rozyczko

Source: EasyReflectometryApp/Backends/Py/logic/parameters.py:155-189 — DEEP_ANALYSIS.md §5 item 2

set_current_parameter_value / set_current_parameter_min / set_current_parameter_max have two defects:

  1. float(new_value) is evaluated in the if condition outside the try, so a non-numeric value raises uncaught.
  2. When the inner assignment's ValueError is swallowed, the method still return True, telling the proxy a change happened (cache cleared, signals emitted) when nothing actually changed.

Impact: Data integrity — the UI reflects a value change that did not occur. The parameter table desynchronizes from the model.

Fix: Move the float() conversion inside the try; return False on failure so callers don't emit change signals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [priority] highShould be prioritized soon[scope] bugBug report or fix (major.minor.PATCH)

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions