Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0050836 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [POS2] Core | major | have not tried | 2022-11-10 13:21 | 2022-11-14 16:51 | |||
Reporter | cberner | View Status | public | |||||
Assigned To | cberner | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 23Q1 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | approved | |||||||
Review Assigned To | ||||||||
OBNetwork customer | No | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0050836: On occasions service worker doesn't properly use the updated files | |||||||
Description | It seems on occasions, there is a reload of the application when a new version of the builds is present and the files being used after the refresh are the same as the old version, another refresh is required for this to be fixed afterwards. The main problem seems to be that the reload of the application could generate a race condition with the activation of the new service worker, we should refresh only afterwards. | |||||||
Steps To Reproduce | 1. Apply this diff serviceWorker.diff attached, it adds a setTimeout on the processing of the skipWaiting message of the service worker 2. Run ant build in core2 3. Start Tomcat server, and use the production build: localhost:8080/openbravo/web/pos 4. Modify the service-worker.js file in WebContent/web/pos/static to generate a new update, you can modify one of the .chunk.js files to see which one is the web page currently using After modification, refresh the webpage, check that we're still using the older version, instead of the new one. You can check this by looking in dev-tools at the Sources tab, check the files that you modified and updated the version. | |||||||
Proposed Solution | Refresh the application on service worker activation, after the messages has been properly created. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() | |||||||
![]() |
|||||||||||||||
|
![]() |
|
(0143387) hgbot (developer) 2022-11-10 13:24 |
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/906 [^] |
(0143587) hgbot (developer) 2022-11-14 16:51 |
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/906 [^] |
(0143589) hgbot (developer) 2022-11-14 16:51 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^] Changeset: 78a3eb5bb63cf1d3e54f1933f060ce3de660a9fc Author: Cristian Berner <cristian.berner@openbravo.com> Date: 14-11-2022 16:00:49 URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/78a3eb5bb63cf1d3e54f1933f060ce3de660a9fc [^] Fixes ISSUE-50836: On occasions service worker doesn't properly use the updated files There is a race-condition when changes are detected in the service worker, and a reload is required. The reload was happening just after sending a Skip Waiting message to the service-worker thread, which sometimes does not allow the service worker to finish its process of fetching + activation, as such it will keep old version .js files until another refresh happens. To avoid this, we refresh the application after we sent the message, but once the service worker is not waiting anymore, and is in an "activated" state. --- M web-jspack/org.openbravo.core2/src/registerServiceWorker.js --- |
![]() |
|||
Date Modified | Username | Field | Change |
2022-11-10 13:21 | cberner | New Issue | |
2022-11-10 13:21 | cberner | Assigned To | => cberner |
2022-11-10 13:21 | cberner | File Added: serviceWorker.diff | |
2022-11-10 13:21 | cberner | OBNetwork customer | => No |
2022-11-10 13:21 | cberner | Triggers an Emergency Pack | => No |
2022-11-10 13:24 | hgbot | Merge Request Status | => open |
2022-11-10 13:24 | hgbot | Note Added: 0143387 | |
2022-11-10 16:45 | guilleaer | Status | new => scheduled |
2022-11-14 16:51 | hgbot | Merge Request Status | open => approved |
2022-11-14 16:51 | hgbot | Resolution | open => fixed |
2022-11-14 16:51 | hgbot | Status | scheduled => closed |
2022-11-14 16:51 | hgbot | Note Added: 0143587 | |
2022-11-14 16:51 | hgbot | Fixed in Version | => 23Q1 |
2022-11-14 16:51 | hgbot | Note Added: 0143589 |
Copyright © 2000 - 2009 MantisBT Group |