-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No Error Handling / check for missing attributes in Notes #218
Comments
Somewhat related: The current live system was broken due to a record with
We do need better error checking. Maybe this should best go into the Entity sub-classes like |
I would suggest to limit this issue to the error handling / attribute checking. @liwde, do you want to create a separate issue for the Foreign Key Handling / cascading delete / ... question? That sounds like a big but important topic. |
Yes, I think getters/setters would be the proper way to go. Should be tested with the CouchDB setup to make sure the getter/setter/private stuff is not creating problems when writing the object to the database |
This is not about getters and setters, but the object itself being undefined. Instead, we must create a |
Okay, so this ist still facing two problems. The first one, lukas mentions, about missing error handling and deletion of Objects. |
When opening the Notes with
"useTemporaryDatabase": false
in theconfig.default.json
, a pretty non-descriptive error-message is shown in a red Message-Toast: "missing(undefined)"In the console, a few more messages appear: The DB could not find an entry to be loaded (
{"status":404,"name":"not_found","message":"missing","reason":"missing"}
) and a later error wherehasPhoto()
is called onundefined
. It seems like the Child related to a Note is not found resulting in the error.In fact,
Note:1536258354699
references a childChild:new
that does not exist. So to fix this now, we could just delete the Note. However, we need to also think about fixing the root cause:1. No Error Handling
child-block.component.ts
has no error handling:I'm not sure if we could let an error here bubble up to the containing
notes-manager.component.html
to somehow remove the child from the Note, or whether a simple in-place message "Child deleted" would be better.However, this relates to...
2. Foreign Key Handling
I don't know what happened to
Child:new
, but it must have been deleted somehow. Today, this is possible from our UI, which directly uses the EntityMapperService to delete the Entity. However, this does not delete foreign keys (e.g. in Notes) or even Entities (e.g. the ChildSchoolRelationship). Are there already ideas on how to handle this? Otherwise, we should think about a concept on how to handle cases like this.The text was updated successfully, but these errors were encountered: