Skip to content

Load tracks in cerebral to avoid JS promises in watch. Remove duplicate tracks with AngularJS watch.

Øyvind Evju requested to merge igv-race-condition into dev

Description

Avoid wrapping JS promises in AngularJS, as this doesn't play well with AngularJS $q-implementation: https://github.com/angular/angular.js/issues/10344

Instead of tying this even tighter with the hopelessly outdated AngularJS, I've implemented a "forgiveness-rather-than-permission"-approach, where we use $watch to remove duplicate tracks instead of trying to prevent them from being created (which had the nasty side effect of blocking the AngularJS digest cycle).

IGVBrowser is now exported and tracks are added/removed in the Cerebral action showHideTracks.

Related issues

Notes to review (code/docs/QA)

Tests

General

  • Tests have been added that prove my fix is effective or that my feature works
  • Related tests have been modified/removed

Hypothesis testing:

  • Soak testing has been done
  • Distribution between positive / negative cases has been checked

Database

  • Includes changes to database schema
  • Includes necessary database migrations

Configuration

  • Includes changes to configuration
  • Includes configuration migration instructions in documentation

Merge checklist

  • Self-review of code has been performed.
  • Feature review and validation against specification has been performed (if applicable). Apply label: QAdone
  • Need for documentation has been evaluated and, if necessary, updated. Apply label: docsdone
  • Code and implementation has been reviewed by other core developer (including any changes based on initial review). Apply label: code reviewdone
Edited by Florian Krull

Merge request reports