Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0045098
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Retail Modules] Web POSmajorhave not tried2020-09-21 11:252022-02-01 08:07
ReportermarvintmView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0045098: IndexedDB ApplicationState infrastructure could help developers find immutability-related issues

DescriptionIn 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.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0045016 closedRetail state actions mutate objects 

-  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
Powered by Mantis Bugtracker