Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor loading very slowly #2617

Open
christad92 opened this issue Oct 29, 2024 · 6 comments
Open

Editor loading very slowly #2617

christad92 opened this issue Oct 29, 2024 · 6 comments
Labels
bug Newly identified bug performance Issues that may affect scalability or performance under stress User Reported This issue is a bug that was reported by a user

Comments

@christad92
Copy link

christad92 commented Oct 29, 2024

Today during a demo I noticed that the editor was very slow when loading and had to wait for about one minute for it to load. The input and output panels were loaded but the editor panel was blank.

Workflow: https://app.openfn.org/projects/fdfdf286-aa8e-4c9e-a1d2-89c1e6928a2a/w/b0849f2a-ac91-4689-b813-ff80c077a2cc?v=87&a=1a12c9c8-6675-49a1-a00f-cbe98357cd90&m=expand&s=d3ef54de-4b6c-4655-a8aa-21d504f1dc27#log

@github-project-automation github-project-automation bot moved this to New Issues in v2 Oct 29, 2024
@christad92 christad92 added bug Newly identified bug User Reported This issue is a bug that was reported by a user labels Oct 29, 2024
@stuartc
Copy link
Member

stuartc commented Oct 30, 2024

I can't reproduce this, has it happened subsequently? With my cache disabled I timed this as fully usable in 5 seconds.

@josephjclark
Copy link
Contributor

I suspect this is related to cache and slow internet. There's like 6mb of editor stuff that needs downloading and if its not cached then it will take some time.

@taylordowns2000 taylordowns2000 added the performance Issues that may affect scalability or performance under stress label Nov 11, 2024
@josephjclark
Copy link
Contributor

Huh - I just saw this!

I loaded this workflow on app.openfn.org, using a good fast stable connection and _surely _ with the actual editor source cached.

It took like 30 seconds for the job code to load.

My dev console shows this:

Job not found 6637fdf1-62f4-446d-8f59-98b7b37dc3e3

Image

That is the job I'm looking at, which did subsequently load.

I think this issue might actually: sometimes there's an error loading job expressions into the inspector and that stops the editor loading

@josephjclark
Copy link
Contributor

Yes, the editor component will not mount until the workflow has been loaded into the zustand store.

The error in my console was thrown in the editor's mount code:

  render() {
    const { adaptor, disabled, disabledMessage, jobId } = this.el.dataset;

    checkAdaptorVersion(adaptor);

    this.findWorkflowEditorStore().then(workflowStore => {
      const job = workflowStore.getState().getById<Lightning.Job>(jobId);

      if (!job) {
        console.error('Job not found', jobId);
        return;
      }

      if (JobEditorComponent) {
        this.componentRoot?.render(
          <JobEditorComponent
            adaptor={adaptor}
            source={job.body}
            metadata={this.metadata}
            disabled={disabled === 'true'}
            disabledMessage={disabledMessage}
            onSourceChanged={src => this.handleContentChange(src)}
          />
        );
      }
    });
  },

@josephjclark
Copy link
Contributor

Refreshing that some page sometimes loads instantly, sometimes takes a while. I'm watching a loading spinner as I type this comment.

@josephjclark
Copy link
Contributor

Seeing this again today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Newly identified bug performance Issues that may affect scalability or performance under stress User Reported This issue is a bug that was reported by a user
Projects
Status: Icebox
Development

No branches or pull requests

4 participants