-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Show diff if server version of script is different to unsaved version of script in VSQlik. #543
Comments
@DAVIDWALES i will start this one as soon as possible, it is currently a very good and valid use case. We allways assume only one edit the app, but i can also think about 2 will edit the application or you are at a presentation and find a small bug or changes so in this case you maybe edit the app (sheets, variable) directly in qlik sense and not open your editor, connect, find the file edit save and reload the data. So i will implement this not only for an app, also variables, sheets, dimension and so one should take care about that.
|
- added Application which holds the document to know when app has been changed - added logic if we open a script file to register for app changed event
if server emits a change checks the scripts, if they changed open a virtual document which is compared with the local version and will be updated if the server emits more changes
- added Application which holds the document to know when app has been changed - added logic if we open a script file to register for app changed event
if server emits a change checks the scripts, if they changed open a virtual document which is compared with the local version and will be updated if the server emits more changes
cache script locally after first time it was opened, this ensures we allways knows there is a diff if we reopen the file and the server version is different from our version.
changed the logic the script will locked as soon it will be opened and unlocked if document is closed again. This will ensure the file is not overridden until it is open, for example editor lost the focus and content will read in again. After document it closed it will unlocked again so next time we get the data from server.
@DAVIDWALES since i'm nearly done with that i think i faced that issue in order this workflow:
So fine it was allready up to date okay cool. Bad things happens here i open both vscode and the browser at the same time and then start to edit in vscode and after that i edit some things in the browser (no time for reload the browser). The same behavior as above with the difference the browser do not notificate me someone has changed something, simply my local changes gets lost in vscode, vscode gains focus -> auto reload script -> browser was last and wins. Solution currently: If you open the script in vscode it becomes "locked" (cached as local version) and starts to listen on app.changed event. Now if someone edit that script (browser / vscode on same/other computer) and save it, we get notified about that the script is different now and a diff shows up. And it stays locked until you close the file. So now for example you can do peer programming on same script with multiple friends, should be working even if vscode lost the focus (some other important app will openend) and switch back to vscode. One thing: If you close the Script the next one who save win's and override the script on the server and your changes are lost if your reopen the script and you never get notfied about that this should ensure you get allways the latest script from server if you open a script and not a older version. To avoid that we need something like a local change history but this becomes an other story. Would this solve your issue on this ? Best regards, |
@r-hannuschka Are you describing the following situation?
Is there a way to tell Qlik Sense to refresh the load script? I think that your solution here (storing a local copy and showing a diff when changes are detected) will solve the original issue. I also agree that the issue you have raised would require a local change history. Down the track, it would be good to be able to link an app to a local git repository, which could be used as the local change history. You could then compare the local working copy with the latest version from the server, and give the user the option to keep their local copy or the server copy. |
- remove memory leak so we dont unsubscribe correctly and observers was still alive - cache script directly after app was opened, avoid multiple calls to get the script - simplyfy diff check - disable load data in diff editor
not really, just try it with two browsers and qlik itself. Even if you make a reload in one app it doesn't fetch the script in the second app.
Yes, this is also on the roadmap. I have it on my wishlist for Xmas, but be honest the chance is maximum 50%. |
@r-hannuschka |
- moved all script filesystem controllers into script module - move logic out of script.module into script guard - now vscode will update the main.qvs file if the server script changes (not if source is edited allready) - show diff if source script has been edited and we have an diff
Adding the custom properties was not working for me, and if i'm right this is not possible for qlik sense server. @see https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/EngineAPI/Content/Structs/NxAppProperties.htm |
…) to app properties the last version of the script will be saved into the app properties, if the script opens again it will check it has been an diff here. In this case the diff editor opeens directly
Is your feature request related to a problem? Please describe.
If you make changes to a script in VSQlik, then make changes in the Qlik Sense load script editor, then come back to VSQlik, it will automatically discard your local changes in favour of what's on the server.
Describe the solution you'd like
It would be good if a diff could be shown in this case, allowing you to choose which conflicting changes to keep, and which to reject.
Describe alternatives you've considered
In theory, you would only ever edit in VSQlik, and never make changes in the Qlik Sense script editor. However, sometimes you forget!
The text was updated successfully, but these errors were encountered: