Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0045098 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
feature request | [Retail Modules] Web POS | major | have not tried | 2020-09-21 11:25 | 2022-02-01 08:07 | |||||||
Reporter | marvintm | View Status | public | |||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | 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 | |||||||||||
Review Assigned To | ||||||||||||
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. | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | ||||||||
|
Notes | |
(0123260) hgbot (developer) 2020-09-21 11:44 |
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/76 [^] |
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 | View Revisions |
2020-09-21 11:26 | marvintm | Description Updated | View Revisions |
2020-09-21 11:26 | marvintm | Description Updated | View Revisions |
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 | View Revisions |
2022-02-01 08:07 | alostale | Assigned To | platform => Triage Platform Base |
Copyright © 2000 - 2009 MantisBT Group |