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

Fix showLogs #7568

Closed
wants to merge 4 commits into from
Closed

Fix showLogs #7568

wants to merge 4 commits into from

Conversation

somebody1234
Copy link
Contributor

Pull Request Description

Fix showLogs, by disabling it if showLogs already exists

Important Notes

This will need to be pushed to cloud in order to work. Tested locally by temporary replacing the URL of the loaded script (normally cloud's index.js.gz) with the locally built one.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@somebody1234 somebody1234 added the CI: No changelog needed Do not require a changelog entry for this PR. label Aug 11, 2023
@PabloBuchu
Copy link
Contributor

i am still having this error module is not defined but showLogs works

Screenshot 2023-08-11 at 16 51 18

this.console[name] = console[name]
console[name] = (...args: unknown[]) => {
this.consume(name, args)
if (shouldExecute) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look right to me that we need such guards. If this code is being executed for the second time, we are already creating an extra new Router() instance anyway, which I believe is incorrect. Usually top level code in JS modules have a guarantee of executing at most once, so it would be better to figure out why this rule is violated and fix that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Frizi the issue is that (currently) the frontend loads the application from the cloud, because the cloud may be running a different version of enso.runApp...?

i don't remember the reasoning why i made the editor do that tbh. i can create an alternate PR that fixes this a different way

@somebody1234 somebody1234 marked this pull request as draft August 11, 2023 15:33
@somebody1234
Copy link
Contributor Author

Closing as draft in favor of #7570.

@PabloBuchu PabloBuchu closed this Aug 14, 2023
mergify bot pushed a commit that referenced this pull request Aug 14, 2023
Fix for `showLogs` when opening a second cloud project. Alternative to #7568.
This one avoids loading the cloud's `index.js.gz`, unless it is in the cloud - and in the cloud, it only loads the first `index.js.gz`.
@somebody1234 somebody1234 deleted the wip/sb/fix-showlogs branch August 14, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants