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
I just had to spend an hour tracking down why leading returns in a copy text were being removed. Luckily I noticed I introduced a Schema for the collection in the update where it broke, otherwise it could have taken me a lot longer.
I would argue that modifying the data like this when the developer has not asked for it, is a bad practice. What if more packages start doing these kinds of 'smart things'? You will be constantly hunting through all of your packages trying to figure out why unexpected stuff is happening.
Furthermore: it seems you cannot even disable this trimming for objects that are blackbox:true. (please correct me if I'm wrong!) This means for my use case (the content property is a blackbox because it's used by multiple modules), the only solution is to disable the schema for this collection.
The text was updated successfully, but these errors were encountered:
It can be disabled when you call clean, or when you call insert or update if using collection2, which calls clean for you (even for blackbox).
At the simple-schema level, I think trimming by default is probably correct because it is what most people will want. But I agree that collection2 doing it for you automatically can be confusing. So I've opened an issue over in the C2 repo: Meteor-Community-Packages/meteor-collection2#283
Hi,
I just had to spend an hour tracking down why leading returns in a copy text were being removed. Luckily I noticed I introduced a Schema for the collection in the update where it broke, otherwise it could have taken me a lot longer.
I would argue that modifying the data like this when the developer has not asked for it, is a bad practice. What if more packages start doing these kinds of 'smart things'? You will be constantly hunting through all of your packages trying to figure out why unexpected stuff is happening.
Furthermore: it seems you cannot even disable this trimming for objects that are
blackbox:true
. (please correct me if I'm wrong!) This means for my use case (thecontent
property is a blackbox because it's used by multiple modules), the only solution is to disable the schema for this collection.The text was updated successfully, but these errors were encountered: