Open AlexStansfield opened 2 months ago
Checked the code and noerror
seems to only affect this error. However it doesn't work if set in schema, only if set on the find operation itself.
So this version of the library went onto our production on Wednesday. In the last 24 hours it has produced 480,000 log messages.
My thoughts on this new error:
noerror
param as naming wise could cover a lot of thingswarnOnMissingRequired
) that is false
by default that could be set in params on schema or on operationIn a later release (maybe next major) the warnOnMissingRequired
could default to true
.
Sounds like a good suggestion.
We should add to the test to not perform for indexes with projection. But your suggestion to reverse the test to be opt-in would be better.
There are already a few places in the code that emit warnings if table.warn is true. So we can extend this.
With the proposed patch, you can set:
If set (and a whole host of conditions are not true), then a warning will be omitted.
This warning is really important if you update your schema and make some fields required, but don't update all items in the database to define the required field. You want to detect that condition. So that is what the warning is for.
With opt-in, as you suggest, you can turn it on globally via the schema or on a per-API basis.
Thanks for raising the issue.
Before releasing this, did this patch address the issue?
Before releasing this, did this patch address the issue?
Which patch?
The current repo includes the params.warn and turns warnings off by default.
Noticed the size of my logs went up about about 50x (no joke).
We have some operations that get thousands of records by an index that is keys only. For every record it spits out an error for every missing required field. For example one request that gets only 200 records, created almost 1000 error messages.
Schema For the Index:
Error: Required field "companyId" in model "Tech" not defined in table item
I saw there is a
noerror
param. Will that turn off all errors or just this "not defined" one? As I still want to catch real errors but currently the size of the logs is starting to cost us money as we pay for Kloudmate by the amount of logs ingested.Otherwise I might have to revert to an older version until this is resolved.
I do feel like this error shouldn't have just been turned on by default, there could have been some flag to switch it on for now that could have been defaulted to on in a later version once any teething problems were resolved.