title: IBM Worklight 6.1 - Direct Update fails when returning to the foreground
body: <p>Worklight 6.1.0<br>
  iOS 7 on iPhone 5s</p>
  
  <p>We have a hybrid application that relies on Worklight server to do the direct update.  The problem occurs when the user minimizes and then re-opens the app, the user is able to see the update dialog, however the update would then fail due to the wrong WL-instance id.</p>
  
  <p>Here is the init options:</p>
  
  <pre><code>var wlInitOptions = {
    connectOnStartup: true,
    onConnectionFailure: function() {
      WL.Logger.error("Failed to connect: " + arguments);
  }
  
  
  WLJSX.bind(window, 'load', function() {
    WL.Client.init(wlInitOptions);
  }
  </code></pre>
  
  <p>Here are the steps I did:</p>
  
  <p>1) Open the IOS application, it will bring me to the first index page of the application, say Page1
  2) Press a button, which brings me to another page, say page2 using GluJs</p>
  
  <pre><code>glu.viewport('MyApp.page2');
  </code></pre>
  
  <p>3) Minimize the application.</p>
  
  <p>4) Modify the WebResource and then deploy the modified Iphone app to Worklight server.</p>
  
  <p>5) Re-open the minimized application, the user gets a prompt to direct update.</p>
  
  <p>6) The update would then fail, and there is a log in Worklight console of the following:</p>
  
  <blockquote>
    <p>[ERROR ] FWLSE0203E: Received bad instance Id from client. Server
    instance Id:'3f9eveddc7br5mq3ll0nq89miu', client instance
    Id:'ut5m5f01i3bkq5l78m54uq137o'. [project trunk]</p>
  </blockquote>