Titanium JIRA Archive
Alloy (ALOY)

[ALOY-644] Alloy should use no persistence when no adapter type is specified

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-04-29T16:00:39.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, 2013 Sprint 09
ComponentsRuntime
Labelsqe-testadded
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2013-04-27T01:02:49.000+0000
Updated2013-07-29T20:56:58.000+0000

Description

Currently when no adapter type is specified in an Alloy model, one is specified by default. On Mobileweb it is the localStorage adapter, on all other it is the SQLite (sql) adapter. This behavior is confusing and undesired in many cases where the developer does not want persistence at all, but just a model to manage the current state of the app. All default adapter types will be removed and a sync adapter with no persistence should be used instead.

Comments

  1. Tony Lukasavage 2013-04-29

    PR: https://github.com/appcelerator/alloy/pull/123 test case: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-644 Functional testing should show console warnings for both the appState.fetch() and model.save() calls in the index.js controller, instead of failing with a sync error exception as they did in the past. The app should function properly without persistence, changing the color and counter on the first tab and then adding the "+" to the end of each row on the 2nd tab. Since no persistence is being used, the models should be reset on each run. This fix modified the central alloy.js file that affects all processing of models. In addition to asserting that the test case behaves as expected, most if not all test apps in the [models folder of the repo](https://github.com/appcelerator/alloy/tree/master/test/apps/models) should be tested to ensure that they still behave as expected. I have done this myself and they all do, but additional testing would also be beneficial.
  2. Federico Casali 2013-07-29

    Verified as working as expected. No persistence is being used and no exception errors are raised. Titanium SDK 3.1.2.v20130726192706 Alloy 1.2.0-alpha Appcelerator Studio 3.1.3.201307252418 CLI 3.1.2 Node 0.8.22 Closing.

JSON Source