Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021361Openbravo ERPA. Platformpublic2012-08-15 17:042012-08-29 17:51
pjuvara 
AugustoMauch 
normalmajoralways
closedfixed 
5
3.0MP12.1 
 
migueldejuana
Google Chrome
Core
No
0021361: Data cannot be saved when server has no access to Internet
I am working on a plane and I have no internet connection to my laptop. I started my local Openbravo 3 MP12.1 virtual machine on VirtualBox with NAT networking instead of bridged and I have setup the network rules to so that there is a port forward from host:8082 to guest:80.
This way I can access Openbravo with the URL http://localhost:8082 [^]

This has always worked with no problem.

Now, I see that when I access the system with Firefox everything is OK and I can use the system.

However, when I access the system with Chrome, everything initially appears to be fine but when I try to save a record I get what appears to be an Openbravo generated message that says "Data cannot be saved because you are not online". See attached screenshot.

This does not make any sense to me. There is no reason for Openbravo to check whether we are online or not (everything is local and the browser can certainly reach the server); also I do not see why Firefox would work and Chrome would not.

This is definitely an edge case (working without network connection) but on the other hand it is a configuration that I have used in many situations to give demos from locations when there is no network access (trade shows, etc.) and I suspect that partners might be in the same position.

Also, I am not sure if this is something that is caused by the browser (I am using Chrome 20) or by Openbravo. If it is caused by the browser, there is not much that we can do about it. If it is caused by Openbravo, I wonder if this is a small symptom that hides some mistakes in our stack.

In any case, this is a regression since it worked in the past.
See above.
No tags attached.
png Screenshot from 2012-07-31 12_11_04.png (107,096) 2012-08-15 17:04
https://issues.openbravo.com/file_download.php?file_id=5503&type=bug
png

png OfflineMessage.png (98,139) 2012-08-16 13:45
https://issues.openbravo.com/file_download.php?file_id=5506&type=bug
png
Issue History
2012-08-15 17:04pjuvaraNew Issue
2012-08-15 17:04pjuvaraAssigned To => alostale
2012-08-15 17:04pjuvaraFile Added: Screenshot from 2012-07-31 12_11_04.png
2012-08-15 17:04pjuvaraWeb browser => Google Chrome
2012-08-15 17:04pjuvaraModules => Core
2012-08-15 17:18iciordiaWeb browserGoogle Chrome => Google Chrome
2012-08-15 17:18iciordiaAssigned Toalostale => AugustoMauch
2012-08-16 13:45AugustoMauchFile Added: OfflineMessage.png
2012-08-16 14:01hgbotCheckin
2012-08-16 14:01hgbotNote Added: 0051324
2012-08-16 14:01hgbotStatusnew => resolved
2012-08-16 14:01hgbotResolutionopen => fixed
2012-08-16 14:01hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/78e4e8656a9db641c300170c8c43a8477d14c761 [^]
2012-08-16 14:03AugustoMauchNote Added: 0051325
2012-08-16 14:04AugustoMauchNote Added: 0051326
2012-08-16 14:05AugustoMauchNote Added: 0051327
2012-08-17 12:25AugustoMauchNote Added: 0051339
2012-08-29 17:51migueldejuanaClosed by => migueldejuana
2012-08-29 17:51migueldejuanaNote Added: 0051646
2012-08-29 17:51migueldejuanaStatusresolved => closed

Notes
(0051324)
hgbot   
2012-08-16 14:01   
Repository: erp/devel/pi
Changeset: 78e4e8656a9db641c300170c8c43a8477d14c761
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Aug 16 13:58:02 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/78e4e8656a9db641c300170c8c43a8477d14c761 [^]

Fixes issue 21361: Data can be saved in local server without internet access

Before this fix, it was not possible to save data without being connected, because of this code in the saveData function:

        if (isc.Offline && isc.Offline.isOffline() && !this.dataSource.clientOnly) {
            isc.warn(this.offlineSaveMessage);
            return;
        }

Offline.isOffline() is defined as follows:

    isOffline : function () {
        if (this.explicitOffline !== null) return this.explicitOffline;
        var offline = window.navigator.onLine ? false : true;
        return offline;
    }

So, by setting Offline.explicitOffline to false, it is possible to go on with the saving process even if the browser detects there is no internet connectivity.

This value is set just before the save, and restored to its original value right after the saving process is completed.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0051325)
AugustoMauch   
2012-08-16 14:03   
Now, if the user is working against a remote server and loses the network connectivity, the warning message he will receive will be the one shown in the attached screenshot.
(0051326)
AugustoMauch   
2012-08-16 14:04   
I have tried to reproduce this issue with previous Openbravo version, and it has been always reproducible (I have gone back until Openbravo 3.0MP3)
(0051327)
AugustoMauch   
2012-08-16 14:05   
In the changeset that fixed the issue I have not made clear that the code that prevented the saving process from working without internet connectivity belongs to Smartclient, not to Openbravo.
(0051339)
AugustoMauch   
2012-08-17 12:25   
This issue is not a regression, it has been reproducible since 3.0MP1
(0051646)
migueldejuana   
2012-08-29 17:51   
Tested and reviewed in pi@19952d22eb0a