Bug 6178

PB IDE brings wrong values of Ancestor Instance variable on refresh 09 April, 2021

Ankur Patel
01 March, 2021
Product: PowerBuilder Category: PowerBuilder IDE
Version: 2019 R2 Build: 2353
Classification: Sybase (legacy) bug Publishing: Public
Priority: P3
Status: Scheduling Reason:
Tom Jiang @Appeon 07 April, 2021
#16
Hi Ankur,

I am sorry to inform you that PowerBuilder 2021 doesn't have this source control enhancement. It is planned for PowerBuilder 2022 as indicated in the roadmap. PowerBuilder 2021's main feature is installable cloud app deployment and the public beta will be available soon. After PowerBuilder 2021 is in GA, the development will start to implement features planned for PowerBuilder 2022.

In the meantime, you may try Miguel's solution to work around the issue. Thanks for your understanding!

Regards,

Tom Jiang
Miguel Leeuwe 06 April, 2021
#15
I forgot to say:
About "PBL generation from the source code whenever it is available", if you cannot wait or want to try it out:
Roland Smith, has created "WizSource" ( https://www.topwizprogramming.com/wizsource.html ), which allows you to generate pbls - using batch/cmd files - from source code. I haven't tried it out myself extensively, but It's free for a single developer. Just to give you an idea, maybe you could combine it with your current sourcesafe somehow.
Regards
Miguel Leeuwe 06 April, 2021
#14
Hi Ankur,
Thanks for explaining, that's quite a setup! 
Myself I (have been) testing the pre-beta of 2021, but I would definitely recommend you to wait until the "real" beta comes out, at least if you're on an Oracle database like me. It should be coming out pretty soon I think (this month?).
regards
Ankur Patel 06 April, 2021
#13
Hello Miguel,

What we do is we bootstrap new PBLs from ws_objects every night using orcascript. So it works fine as long as developers are taking the newly created PBLs every day from the network shared drive. The only problem is if some developer doesn't take the new PBLs for a long time and then takes the latest code from git and refreshes the PBLs using IDE it may create this issue.

@Tom,
Is it possible to get early access to PB 2021 Beta so we can test the new feature that you mentioned regarding supporting PBL generation from the source code whenever it is available? I can see that in the new Bug screen there is an option to select PB 2021 Beta so it looks like private beta has already started.

Thanks,
Ankur Patel
Miguel Leeuwe 05 April, 2021
#12
Hi Ankur,
Just to say "thumbs up for reporting this bug!".
Also, maybe a solution for you could be to use the powerbuilder compiler tool / ORCA and regenerate the pbls (maybe 3 times during the night?) in the exact order that you want.
regards
Tom Jiang @Appeon 02 April, 2021
#11
Hi Ankur,

I don't have the detail of this enhancement but it already listed on our website: https://www.appeon.com/developers/roadmap
Under Enhancing Git/SVN: It says supporting PBL generation from the source code, thus eliminating the need to upload PBLs to Git/SVN. 

I assume that you are doing a similar thing right now: Generating PBLs directly from the source code object files. To temporarily work around this issue, you may try committing the PBLs once in a while, this way, you don't have to refresh all the old objects every time, but only the modified ones, which should greatly avoid this issue. This is also part of the reason that we have the Upload PBL function in the current PB IDE. 

In the meantime, I’ve been talking with the development team on your suggestion of adjusting the importing order. But as any adjustment in this area could potentially affect a lot of customers, it would require a lot of extra effort in development and QA for a temporary workaround. It would make much more sense to put this effort into the coming enhancement. 

Anyway, we are keeping improving all the features in PB IDE and source control is a big part of it. We will keep you updated!
 
Thanks & Regards,

Tom Jiang
Ankur Patel 30 March, 2021
#10
Hello Tom,

Currently, our development has a plan to get rid of the PBLs from the source control and generate them dynamically and they will handle this issue together when implementing that feature.
-> I would like to know the details regarding this and what is the tentative timeline for this.

Also, Is it not possible to at least import and regenerate the objects in the same sequence the PBLs are there in PBT file instead of importing the ws_objects folder alphabetically. I understand that this will not fix the issue completely but at least the issue will be much less severe than what it is currently. Currently, what happens is most of our windows are regenerated before the u_dw since the u_dw is in the pfemain folder which creates this issue in a lot of windows. We can at least avoid this somewhat if was following the sequence in the pbt file.

Also, the workaround of the full build is not very feasible. The full build takes around 1.5 hours so we only do this every night but during the daytime, we may have to take the latest code from git and at that time we cannot ask developers to wait for 1.5 hours. Also, the regeneration/full build is a manual process that developers need to follow which they can easily forget.

I do understand that since compiler code is complicated and you guys are already working to get rid of PBLs from source control, you do not want to make more changes on this. What I am asking is just a simple change of importing objects in the sequence of PBLs in the PBT file instead of alphabetically.

Thanks,
Ankur Patel
Tom Jiang @Appeon 10 March, 2021
#9
Hi Ankur,

Our development has done some initial analysis of the issue. We found that it is related to the underlying compiler of the PowerBuilder IDE. Actually, the same issue exists in PowerBuilder 12.6.

As it is a legacy bug and the complier code is very complicated, we will need some more time to find a good way to handle this issue. Currently, our development has a plan to get rid of the PBLs from the source control and generate them dynamically and they will handle this issue together when implementing that feature.  

At this moment, we suggest that you do a full build or regenerate the object in error to work around this issue.

Regards,

Tom Jiang
Ankur Patel 09 March, 2021
#8
Hello Tom,

Any update on the issue?

Thanks,
Ankur Patel
Tom Jiang @Appeon 05 March, 2021
#7
Hi Ankur,

I can reproduce the issue and I’ve passed it to our development for further analysis for a solution. I will update you when there is any progress on this issue.

Regards,

Tom Jiang
Ankur Patel 04 March, 2021
#6
Hello Tom,

Any luck in replicating the issue?

Thanks,
Ankur Patel
Tom Jiang @Appeon 02 March, 2021
#5
Hi Ankur,

Thanks for submitting the issue with the detailed steps! I will try to reproduce and analyze the issue. I will keep you updated!

Regards,

Tom Jiang
Chris Pollach @Appeon 01 March, 2021
#4
Hi Ankur;

  Thank you the extra feedback. This is most helpful!

  Also, thank you for your patience while we try & replicate this issue.
Ankur Patel 01 March, 2021
#3
Hello Chris,

Thanks for your prompt response on this. If you see the test application, I was able to replicate the issue using 2 simple objects without using any frameworks. So I don't think it has anything to do with the framework itself. Also, I have replicated this issue in 2 different machines. Once on my machine and once on a freshly installed Windows 10 machine and I was able to replicate the issue in both the machine. So I don't think SCM software has any issues either.

Let me know if you guys face any issues in the replication steps.
Chris Pollach @Appeon 01 March, 2021
#2
Hi Ankur;

   Thank you for the Test Case and detailed steps to recreate your issue. We will need some time to recreate and investigate this issue. Note that we do not have any related tickets in the system at this time for this problem. Also, many PB applications use various frameworks - including the PFC - and no such instance variable anomaly has been reported in any Appeon PB release. So it might be quite possible that the issue is either in the SCM software or the PFC.

   Please make sure that you are using the latest PFC release that matches the PB2019 Rx current release.
FYI: http://github.com/OpenSourcePFCLibraries

   In the meantime, I will now transfer this ticket over to the main Support / Engineering team for their review & feedback.

Regards ... Chris
Ankur Patel 01 March, 2021
#1
pb_ide_refresh_bug_demo.zip (2795KB)

*Phenomenon: Powerbuilder IDE refreshes objects in the wrong order which creates the issue of wrong ancestor instance variable values getting set.


*Reproduce Steps: 
I have attached the Demo code and a video showing all the steps to reproduce the issue. The steps are as below.

1. Create a new workspace.
2. create a new application
3. Create a new PBL named: pfemain
4. Create a new standard visual object from datawindow and name it u_dw. Save it in pfemain.pbl
5. Declare a boolean instance variable as shown below.
boolean ib_test = True
6. Create a new PBL named: master
7. Create a new window named: w_test
8. Put the u_dw on the window.
9. Check that the property pane of the newly placed u_dw (dw_1) shows the property ib_test as a checked checkbox.
10. Add the workspace to the Git repository which will create the ws_objects folder. Now push the repository and the initial PBLs to the remote repository. I have pushed this demo code to GitHub as well so you can use that GitHub repository to perform the next steps. The URL is: https://github.com/ankurp-meditab/pb_ide_refresh_bug
11. Now add few more instance variables to u_dw as shown below.
boolean 		ib_test2 = True
String			is_test = "BUG"
12. Now add an instance variable in w_test as shown below. (You can just make any change in w_test, it doesn't really matter)
String			is_test
13. Now do a second commit which will commit both the u_dw and w_test to the Git repository.
14. Push the changes to the remote.
15. Now close the opened workspace and right-click on the empty workspace and choose "connect to workspace".
16. Select the Source Control System as "Git"
17. Repository URL: https://github.com/ankurp-meditab/pb_ide_refresh_bug.git
18. Add your user id, password and choose a checkout directory.
19. Now, PB IDE will download the PBLs and ws_objects folder.
20. The download PBLs are from the initial commit and do not contain the changes that we did in the second commit.
21. Open both the u_dw and w_test and verify that they contain the initial version of the object. The w_test.dw_1 property pane will show the ib_test as a checked checkbox.
22. Now, right-click on the workspace and click on Refresh which will import both the u_dw and w_test.
23. Now, here is where the issue starts. w_test is imported first even though, it is in the 3rd pbl because PB IDE imports the objects in the alphabetic order of the ws_objects folder. Since the master.pbl.src comes before pfemain.pbl.src it will import w_test first and then import the u_dw. The compilation and regeneration order will also be the same. w_test is compiled and regenerated before u_dw.
24. Now open u_dw, you will see the new instance variables with their default values.
25. Now open w_test and check the property of w_test.dw_1, you will see that default value of all the instance variables of u_dw is now gone.
All the boolean variables are set to false (it will show the checkbox for all the boolean variable as unchecked)
All the string variables are set to empty string, even though it has value in u_dw.
26. Now, once you make any changes in w_test. For example, add/change the title and save the window, it will give you syntax error in this test application.
27. The problem we are facing is, in our big application, it is not actually giving syntax error, instead what it is doing is it is setting those changed values in the property of dw_1. So if you open the edit source of the window, it will show the variable ib_test set to false in the property section of the dw_1.
28. This effectively changes the behavior of the program without the developers even realizing it. 

This is a very very serious issue. 

Please don't put off this bug saying that this issue was there in the Old SCC interface as well. It really doesn't matter if it was there in the old SCC interface or not. This has to be fixed as soon as possible.

I have tested this using the Powerbuilder 2019 R2 2353. I have also tested this using the PowerBuilder 2019 R3 2670. Both the versions are having the same issue.

Solution:
Temporary solution:
Import the objects in the order of PBLs defined in the pbt file not alphabetically.

Permanent solution:
The order should not matter. Refresh should do passes for all the objects that need to be imported just like when we do full build so even though PBLs are out of order this issue would not arise.

Please let me know if you need any more details regarding this issue. 

Thanks,
Ankur Patel
OS:
Windows 10
Platform:
All
Database Type:
Database Version: