Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-4435

Don't block translate5 loading when the UI logger is not available

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • None
    • None
    • Editor general
    • High
    • If the third party UI logger is not available that might lead to loading problems of translate5 (waiting for load of the third party files). This is solved now.

      problem

      If therootcause serves are not responding (running into timeouts) then the load of translate5 will also wait for the timeout. Thats annoying. Therefore we have to handle that better as outlined below.

      const script = document.createElement('script');
      script.src = "https://app.therootcause.io/rootcause-full-extjs.js";
      script.crossOrigin = "anonymous";
      script.async = true; // Verhindert das Blockieren des Seitenaufbaus
      
      // Event für erfolgreiches Laden des Scripts
      script.onload = () => {
          console.log("Script erfolgreich geladen.");
          // Hier kannst du deinen Code ausführen, der von der geladenen Bibliothek abhängt
          if (window.RC) {
              const jslogger = new RC.Logger();
              console.log("RC Logger initialisiert:", jslogger);
          }
      };
      
      // Fehlerhandling
      script.onerror = () => console.error("Script konnte nicht geladen werden.");
      
      // Script zur Seite hinzufügen
      document.head.appendChild(script); 

      Please test thoroughly that handling with a URL under your control

      • target server down
      • regarding not available at all
      • long time for answering (provovating timeouts).

      Also please test what happens if therootcause was loaded properly, provocate a JS error so that the dialog popsup, then switch of LAN then try to save the error message. How is therootcause lib handling that?

            pavelperminov Pavel Perminov
            tlauria Thomas Lauria
            Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: