You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to operate on a layout that does not exist in local storage, the current behaviour of LocalLayoutPersistenceManager is to continue regardless (see Current Behaviour below). We want to change this so that an exception is thrown whenever we try to access a layout with an non-existant ID.
Current Behaviour
The current behaviour is as follows, when provided with an ID that does not correspond to any layout in local storage:
updateLayout will add a new layout (and metadata) with the provided ID
deleteLayout will leave local storage unaltered
loadLayout will log a warning and return an empty object
Work Required
Adapt the updateLayout, deleteLayout and loadLayout methods in LocalLayoutPersistenceManager, so that an exception is thrown if there is no layout or metadata in storage with the requested ID
Consider adding a common method to avoid duplication, e.g. validateId (use a consistent approach for all three methods)
Handle the new exceptions wherever the methods are being used*
* At time of writing, none of these methods are being used.
Notes
There is a warningLayout, which might be sensible to display when one of these exceptions is thrown.
Background
When attempting to operate on a layout that does not exist in local storage, the current behaviour of
LocalLayoutPersistenceManager
is to continue regardless (see Current Behaviour below). We want to change this so that an exception is thrown whenever we try to access a layout with an non-existant ID.Current Behaviour
The current behaviour is as follows, when provided with an ID that does not correspond to any layout in local storage:
updateLayout
will add a new layout (and metadata) with the provided IDdeleteLayout
will leave local storage unalteredloadLayout
will log a warning and return an empty objectWork Required
updateLayout
,deleteLayout
andloadLayout
methods inLocalLayoutPersistenceManager
, so that an exception is thrown if there is no layout or metadata in storage with the requested IDvalidateId
(use a consistent approach for all three methods)* At time of writing, none of these methods are being used.
Notes
There is a
warningLayout
, which might be sensible to display when one of these exceptions is thrown.Links
Initial discussion
The text was updated successfully, but these errors were encountered: