IGS / gEAR

The gEAR Portal was created as a data archive and viewer for gene expression data including microarrays, bulk RNA-Seq, single-cell RNA-Seq and more.
https://umgear.org
GNU Affero General Public License v3.0
10 stars 5 forks source link

UI-V2 - Potential race condition loading plugins #665

Open adkinsrs opened 2 months ago

adkinsrs commented 2 months ago

Occasionally I get the following error Uncaught (in promise) TypeError: Cannot set properties of null (setting 'innerHTML') in the following code block https://github.com/IGS/gEAR/blob/23832009af7b1ef1eb83a646d2c8535631cf603f/www/js/common.v2.js#L514-L522

This error happens spontaneously (cannot reproduce), and it seems the fetch is occurring before the element is created. I checked and the "fetch" is returning successfully but the plugin_name + "_html_c" element is not in the body. Maybe line 516 should be moved within the ".then" at line 520.

Two minor nitpicks/suggestions

  1. Since plugin_html_element.id is already defined, use that in the getElementById instead of writing out the string again.
  2. Replace var with let/const in the "for" loop (for consistency with modern JS)
jorvis commented 2 months ago

Addressed all these. There was definitely some un-refactored code copied here from v1 I didn't modernize.

adkinsrs commented 3 weeks ago
Screenshot 2024-04-22 at 9 31 16 AM

Still observing this (the second error was from clicking the "functional annotation dropdown".)

Screenshot 2024-04-22 at 9 32 12 AM