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

Occasional loss of a requiredFile in HTMLView #522

Open
jgclark opened this issue Jan 27, 2024 · 2 comments
Open

Occasional loss of a requiredFile in HTMLView #522

jgclark opened this issue Jan 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working P-5 Priority 5 (med)

Comments

@jgclark
Copy link
Collaborator

jgclark commented Jan 27, 2024

For some months I've had occasional examples of this behaviour: the Dashboard is open and an onSave trigger on the daily note correctly asks for an update to this display.

The right-hand part here is what is displayed. All the text is correct, and most but not all of the formatting is right.

As you may remember after generating the HTML and sending it to the API, I then persist a copy of it to a local file. The left-hand part here is what happens when I render that in Safari (my usual way of debugging complex HTML). This shows it completely as expected.
image
This happens I reckon about 1 refresh in 60, but I can't find more of a pattern than that. When I refresh the Dashboard it always corrects itself.
There are no errors or warnings in the log. Specifically this is happening on b1085 on my main machine; I'm keeping that on the 3.9.5 release to avoid the other major bug.

I've reverse engineered what is happening. There are two sources of CSS:

  1. contained in the main HTML that's generated.
  2. comes from a static dashboard.css file which is one of the "plugin.requiredFiles" defined for the plugin.

If I manually disable all uses of that file in the Safari debugger/inspector, it then looks exactly like the wrong image above. Therefore, I'm 99% sure that occasionally when an existing HTML window is being re-used, a requiredFile is somehow not read or applied.

Originally discussed in Discord thread

@jgclark jgclark added bug Something isn't working P-5 Priority 5 (med) labels Jan 27, 2024
@jgclark
Copy link
Collaborator Author

jgclark commented Jan 27, 2024

FYI the HTML starts:

</head>
<title>Dashboard (45 items)</title>
<meta charset="utf-8">
<!-- Load in Dashboard-specific CSS -->
<link href="dashboard.css" rel="stylesheet">
<!-- Load in fontawesome assets from np.Shared (licensed for NotePlan) -->
<link href="../np.Shared/fontawesome.css" rel="stylesheet">
<link href="../np.Shared/regular.min.flat4NP.css" rel="stylesheet">
<link href="../np.Shared/solid.min.flat4NP.css" rel="stylesheet">
<link href="../np.Shared/light.min.flat4NP.css" rel="stylesheet">
...

The FontAwesome assets always seem to load OK even when the css doesn't.

I've seen it happen in several different plugins, and George65 has also seen it.

@jgclark
Copy link
Collaborator Author

jgclark commented Jan 27, 2024

In Dec 2023 @EduardMe said:

Could be a bug with Apple's class, but looks more likely some form of timing issue. Not sure where to start looking for this issue though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-5 Priority 5 (med)
Projects
None yet
Development

No branches or pull requests

2 participants