Openbravo Issue Tracking System - Retail Modules | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0045098 | Retail Modules | Web POS | public | 2020-09-21 11:25 | 2022-02-01 08:07 | |||||||
Reporter | marvintm | |||||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | normal | Severity | major | Reproducibility | have not tried | |||||||
Status | new | Resolution | open | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | Fixed in Version | |||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | ||||||||||||
OBNetwork customer | ||||||||||||
Support ticket | ||||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0045098: IndexedDB ApplicationState infrastructure could help developers find immutability-related issues | |||||||||||
Description | In the IndexedDB-based Application State components, actions must be pure functions that should not mutate any parameter they receive. This is a very important requirement which is the base for the new layer implementation, and responsible for most of the benefits it provides. However, when developing those actions, it is easy to forget this requirement, and therefore easy to make mistakes. At the same time, those mistakes are not immediately obvious in many cases, and therefore they are easy to miss, and may end up in development code causing bugs and regressions. There is one improvement that could be implemented, that would greatly help developers to detect these mistakes, so they can fix them. It would consist on the following: - When working in development mode, we could freeze the application state (using deepFreeze library) - In development mode, when executing actions we could run the code in strict mode With these two changes, any mutation of any property at the state, at any level, would immediately produce a Javascript error. This would be great because developers would immediately notice the problem. At the same time, it is important to do this only in development mode, as it has an associated performance impact which we don't need to pay when running in production environments. The main idea is to deepFreeze both of: - The main application state (including all state properties) - The payload in action execution (this is to prevent silly mistakes that we saw in the related issue) | |||||||||||
Steps To Reproduce | - Implement an action that mutates the state - Realise that in most cases, if you dispatch the action the mutation takes place but you don't realise it. | |||||||||||
Proposed Solution | ||||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2020-09-21 11:25 | marvintm | New Issue | ||||||||||
2020-09-21 11:25 | marvintm | Assigned To | => platform | |||||||||
2020-09-21 11:25 | marvintm | Triggers an Emergency Pack | => No | |||||||||
2020-09-21 11:25 | marvintm | Description Updated | bug_revision_view_page.php?rev_id=21719#r21719 | |||||||||
2020-09-21 11:26 | marvintm | Description Updated | bug_revision_view_page.php?rev_id=21720#r21720 | |||||||||
2020-09-21 11:26 | marvintm | Description Updated | bug_revision_view_page.php?rev_id=21721#r21721 | |||||||||
2020-09-21 11:28 | marvintm | Relationship added | related to 0045016 | |||||||||
2020-09-21 11:44 | hgbot | Note Added: 0123260 | ||||||||||
2020-09-21 12:32 | marvintm | Description Updated | bug_revision_view_page.php?rev_id=21722#r21722 | |||||||||
2022-02-01 08:07 | alostale | Assigned To | platform => Triage Platform Base |
Notes | |||||
|
|||||
|
|