-
Notifications
You must be signed in to change notification settings - Fork 48
Saving a class leads to three compiles #1526
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
Comments
Hi @TwaHendrik, thanks for that additional info. I created an issue for your problem. This point is very interesting:
I would not expect this setting to change the behavior when a class is edited inside of VS Code. Do you have any other programs that might be changing the file after it gets saved, like git hooks? I have not been able to reproduce this issue so far. |
Hi @isc-bsaviano , We have simplified the test scenario as much as possible. We have started a completely new Docker with IRIS 2024.1 (Image: containers.intersystems.com/intersystems/iris:2024.1). No custom settings made. The Settings.json also only contains the default settings and a completely new vs code folder. We create only one class in default USER Namespace and save it via crtl + s. Class
Output
I hope this helps to reproduce the error. |
Hi @TwaHendrik, thanks for the detailed reproduction steps.I still cannot get this to occur. Here's what I did:
|
Hi @isc-bsaviano , We have tested it again on Mac OS and it works there. There seems to be a difference between windows and mac.
|
HI @TwaHendrik, I was testing on Mac. I will have access to a Windows machine on Monday so I will test this again then. |
I was able to reproduce this on Windows. |
@TwaHendrik I haven't been able to reproduce this reliably, even on Windows. Can you please install the VSIX in the attached zip file and let me know if it fixes the issue? It has a bunch of logging that should help me identify the issue, plus a small change that may have fixed it. |
Hi @isc-bsaviano , we have installed the version and still get the error. The output is: Will save file:///d:/projects/wops/src/cls/Sample/Test2.cls Compilation started on 04/22/2025 13:44:57 with qualifiers 'cuk' Compilation started on 04/22/2025 13:45:01 with qualifiers 'cuk' Hope this will help you to find the problem. |
Thanks for trying that. Was that the entire contents of the ObjectScript Output channel? It looks like two file events were triggered at the same time, which is strange. I've added a few more log events to the attached VSIX. Can you try this again and send me the entire contents of the Output channel? Thanks again for your help. |
Hi @isc-bsaviano , yes, it was the complete output. Here is the new output. This time there was a lot of compeling again: Will save file:///d:/projects/wops/src/cls/Sample/Test2.cls Compilation started on 04/22/2025 15:00:53 with qualifiers 'cuk' Compilation started on 04/22/2025 15:00:55 with qualifiers 'cuk' Compilation started on 04/22/2025 15:00:57 with qualifiers 'cuk' Compilation started on 04/22/2025 15:00:59 with qualifiers 'cuk' Compilation started on 04/22/2025 15:01:02 with qualifiers 'cuk' Compilation started on 04/22/2025 15:01:05 with qualifiers 'cuk' Compilation started on 04/22/2025 15:01:06 with qualifiers 'cuk' Compilation started on 04/22/2025 15:01:08 with qualifiers 'cuk' Compilation started on 04/22/2025 15:01:10 with qualifiers 'cuk' Compilation started on 04/22/2025 15:01:11 with qualifiers 'cuk' |
Thanks, that log output is much more useful. Here's what's going on:
You saved the class, the index of the workspace folder was updated, and the change is about to be synced with the server.
The class was synced with the server and compiled. The text of the class was retrieved from the server in case it was changed due to the sync/compile. The retrieved text was written to the file, which triggered a file system event. The event did not attempt to re-sync, because it was triggered by an export from the server. Everything looks good so far.
This is where the problem starts. For some reason, a second file system event is triggered. Since the "exported" flag is cleared, our extension thinks this is a change that needs to be synced with the server. This causes the multi-compile loop. I don't know why that extra event is happening, or why it only happens some of the time. Just to confirm, you have a single folder open, not a |
Hi @isc-bsaviano ,
Let use know, if you need any further informations. |
Thanks for the confirmation. I think I have a fix. I've added some code that sores the timestamp of the last file system event and if the current one occurred very close to that timestamp, the second event is ignored. I've added a temporary setting "objectscript.TEST" that controls the time limit for an event to be considered a duplicate so we can change the value without me having to send you another VSIX. The default value is 25 ms, which I think is short enough that no human-triggered duplicate events would be ignored. If this works, you should not see the multi-compile issue and a line starting with "duplicate" will appear in the Output channel. |
Hi @isc-bsaviano , if we use the value ‘objectscript.TEST’:300, it seems to work with only one compilation. |
Thanks for checking @TwaHendrik. Did any value lower than that work? I will clean up the code and open the PR on Monday. Unfortunately my remote desktop into my Windows machine is not working. |
Thanks @isc-bsaviano . I tried with lower values but that doesn't work. This period is sometimes not enough. |
@TwaHendrik Thanks again for helping me debug this! Version 3.0.2-beta.6 has the fix. |
We have updated to the new version 3.0.1. Now we have the problem described.
After saving, we get this output. The class was compiled three times.
It was a very simple class without any dependencies.
`Compilation started on 04/07/2025 08:40:41 with qualifiers 'cukb'
Class twa.unittests.util.TestHelper is up-to-date.
Compilation finished successfully in 0.099s.
Compilation started on 04/07/2025 08:40:42 with qualifiers 'cukb'
Class twa.unittests.util.TestHelper is up-to-date.
Compilation finished successfully in 0.018s.
Compilation started on 04/07/2025 08:40:43 with qualifiers 'cukb'
Class twa.unittests.util.TestHelper is up-to-date.
Compilation finished successfully in 0.020s.`
Originally posted by @TwaHendrik in #1470 (comment)
The text was updated successfully, but these errors were encountered: