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

[Bug]: loadUrl sometimes returns wrong html content #36138

Closed
3 tasks done
bayun2 opened this issue Oct 26, 2022 · 4 comments
Closed
3 tasks done

[Bug]: loadUrl sometimes returns wrong html content #36138

bayun2 opened this issue Oct 26, 2022 · 4 comments
Labels
21-x-y blocked/need-repro Needs a test case to reproduce the bug bug 🪲 platform/macOS

Comments

@bayun2
Copy link

bayun2 commented Oct 26, 2022

Preflight Checklist

Electron Version

21.0.1

What operating system are you using?

macOS

Operating System Version

macOS Big Sur 11.5.2

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

loadURL can return correct html content

Actual Behavior

loadURL can return correct html content at first, when i use cmd + R to refresh html, sometimes return js content as html.

html file content inside asar is always correct

Testcase Gist URL

No response

Additional Information

when i use cmd + R to refresh html, sometimes return js content as html.

image

image

image

html file content inside asar is always correct
image

loadUrl in the following way
image

windowConfig

static defaultWindowOptions: () => Electron.BrowserWindowConstructorOptions = () => ({
  ...LBConfig.defaultWindowSizeOptions,
  minWidth: 1440,
  minHeight: 800,
  titleBarStyle: 'hidden',
  frame: false,
  titleBarOverlay: false,
  acceptFirstMouse: true,
  webPreferences: {
    minimumFontSize,
    sandbox: false,
    nodeIntegration: false,
    contextIsolation: true,
    preload: __dirname + '/preload.js',
    devTools: true,
  }
})

Probably an error caused by autoupdate,The zip package has been downloaded, but the installation has not been triggered

@bayun2 bayun2 changed the title [Bug]: [Bug]: loadUrl sometimes returns wrong html content Oct 26, 2022
@deermichel
Copy link
Contributor

deermichel commented Oct 26, 2022

Thanks for reporting this and helping to make Electron better!

Because of time constraints, triaging code with third-party dependencies is usually not feasible for a small team like Electron's.

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

I'm adding the blocked/need-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

Regarding the update hypothesis, there might be a small time window during app restart when an update is applied that causes undefined behavior (ref #36117) - however this doesn't affect the app during regular runtime (including reloads).

@deermichel deermichel added platform/macOS blocked/need-repro Needs a test case to reproduce the bug 21-x-y labels Oct 26, 2022
@bayun2
Copy link
Author

bayun2 commented Oct 28, 2022

@deermichel thank you for your reply.

I have found a path to reproduce.

When the software exits with quitAndInstall or autoInstallOnAppQuit = true, if the software is quickly opened again during Shipit running, the software is still running the old code. At this time, the bug described can be reproduced by refreshing with cmd+R.

I'm sorry, I can't provide a direct testcase because this bug depends on an update of the package to reproduce

@VerteDinde
Copy link
Member

@bayun2 We have a fix for this Shipit bug incoming here: #36130

@codebytere
Copy link
Member

Closing as #36130 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
21-x-y blocked/need-repro Needs a test case to reproduce the bug bug 🪲 platform/macOS
Projects
None yet
Development

No branches or pull requests

4 participants