Skip to content

Fix gene-selection workflow logic errors and null guards in crispr_scripts.js #81

@AlexJSully

Description

@AlexJSully

Summary

Gene selection and work rendering contain logic bugs and undefined references that can allow invalid state, fail silently, or throw runtime errors.

Why this matters

Incorrect boolean conditions and missing guards can lead to broken flows, incorrect error messages, and hard-to-debug crashes when gene data is missing or malformed.

Scope

  • core/scripts/crispr_scripts.js

Tasks

  • Fix always-true / always-false conditionals in select_Gene and loadWork.
  • Initialize string builders before concatenation in fillGeneList to avoid 'undefined' prefix.
  • Replace undefined backgroundInfo reference and add explicit null checks with clear user-facing errors.
  • Add minimal unit coverage for the corrected branches.

Acceptance criteria

  • Gene selection never falls into invalid state silently.
  • loadWork only renders when required data is present; otherwise shows a deterministic error.
  • Tests cover success and failure paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions