#required fields

1 messages · Page 1 of 1 (latest)

torn forum
#

I noticed this a bit back (08 maybe?) felt like it was pretty firmly in the "play stupid games win stupid prizes" category of 'unintended but not really a bug.'

dim raptor
#

That's my gut feeling too, it's not something a sane person should do, but it also isn't necessarily wrong either.

The better question is if by doing so one can break core dialogs trying to open or anything like that. If so, that would be a bug

rustic creek
#

Well, there is an argument to be made for just preventing updates to documents that put them in a state where they don’t pass validation anymore…

remote sierra
#

document.update({"-=_id": null}) should certainly be illegal. No sane person would ever do that willingly, but I'm not sure if you how you would recover from executing that

rustic creek
remote sierra
#

I just noticed that, if I delete a required property, it's undefined, but when I reload, it's set to the default value

dim raptor
#

Makes sense, that's basically what I expected it to do, realistically speaking

rustic creek
#

Interesting… I would probably consider that a bug…

#

If it’s reset in the database, the same should be happening for the in memory document

dim raptor
#

My guess is that what's happening is that re-loading the page is re-initializing the documents from database. And when that happens, when it builds the objects in memory, it populates the required fields with defaults

golden ridge
#

definitely not intended, but we clearly don't have certain checks in place to prevent you shooting yourself in the foot (head?)

#

In terms of what we might do differently, I would want to focus specifically on the V10 behavior here, since this overlaps a lot with the data model and data fields changes