Incorrect scripts being delivered to the web client

Thursday, March 20th, 2008

I’ve just wasted a few hours investigating an annoying bug - or possibly just a feature that we’re not aware of?

After making changes to a client side script and and trying to debug I was getting puzzled why changes I’d made in the designer were not being delivered to the client. 

At first I though this was just a IE “feature” so I cleared out the temporary files and cookies but this did not solve the problem, however it did solve another issue where the web client filters were not working correctly. Out of chance I ran the iisreset command and this allowed the correct version to be delivered, however after the next code change the client again received the older script.

Next under the microscope was IIS, this I assumed must be caching the files on initial delivery. After tweaking a few things it appeared this was in the clear to.  Back to the drawing board and running iisreset at every change.

After leaving the issue for a while I was inspecting the DOM of a delivered page and noticed the client script delivery mechanism:

<script type="text/JScript" 
        language="JScript" 
        src="eScript.ashx?AttachmentFile=ClientScript.js&amp;
             AttachmentOwner=map1&amp;
             AttachmentType=Procedure&amp;
             Service=Metastorm BPM Server&amp;

             Ver=29"></script>

Notice the “Ver=29″ tag?  Now this means that the web client is looking for a specific version of the client side script however if you had turned off versioning in the designer after initially publishing the procedure without really knowing what it does it means that no matter how many times you subsequently publish any newer scripts will not be delivered to the client.

I’m not sure if this is a bug or what Metastorm would call a feature but it’s certainly not obvious and surely the web client should then not attempt to retrieve versioned client scripts?  Earlier in the day I’d unchecked many of the check boxes under the Metastorm Designer’s publisher options section to remove the annoying pop ups that you get when developing.  Looks like it was one checkbox too many.  Roll on version 7.6…

Hope this saves you some time if you also get caught by this “feature”.