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
NOTE - Also posted this bug here in aldeed:collection2. Wasn't sure which package it's rooted in. Will close in both once it's resolved.
Describe the bug
Ran into an issue upgrading my project to Meteor 2.16 from 2.7.2 (on my way up to 3.0).
When using aldeed:[email protected] with the included aldeed:[email protected] on a Meteor 2.16 project along with matb33:[email protected] (latest version), using the collection hook's direct versions that bypass a collection's hook will cause the defaultValue and autoValue set in the schema to also not run. The added logic in the defined simple schema gets bypassed and the document gets inserted/updated as if simple schema doesn't exist. I have tested matb33:collection-hooks and it seems the problem is rooted in aldeed:collection2 or aldeed:simple-schema. If you drop back down to aldeed:[email protected] and use meteor npm install [email protected] with any version of matb33:collection-hooks all works as expected.
To Reproduce
I've hotrodded the React Simple Todos demo to display the error in a repo here.
A link will be inserted in the list without using the direct version in the insert. The insert is performed and the link's description and createdAt are all successfully set using either Simple Schema's defaultValue or autoValue. You'll also notice the link's linkType is set to "video" by the defined and working LinksCollection.before.insert hook.
Click on the Add New Link (Direct) button.
A link will be inserted in the list using the direct version in the insert. The insert is performed but the link will not get any of the Simple Schema logic (e.g. defaultValue or autoValue) however it does get inserted. And the hook is not performed so its linkType is still "website".
Expected behavior
Making use of a matb33:collection-hookdirect call should still run the Simple Schema logic (e.g. defaultValue or autoValue) and validation. Using aldeed:[email protected] and meteor npm install [email protected] all works as expected. Feel free to comment out aldeed:collection2 and uncomment aldeed:[email protected] in the packages.js file and then do a meteor npm install [email protected] and then update the import in links.js to see it working correctly on the prior versions.
The text was updated successfully, but these errors were encountered:
We, the Members of Meteor Community Packages take every issue seriously.
Our goal is to provide long-term lifecycles for packages and keep up
with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.
However, we contribute to these packages mostly in our free time.
Therefore, we can't guarantee your issues to be solved within certain time.
If you think this issue is trivial to solve, don't hesitate to submit
a pull request, too! We will accompany you in the process with reviews and hints
on how to get development set up.
Please also consider sponsoring the maintainers of the package.
If you don't know who is currently maintaining this package, just leave a comment
and we'll let you know
NOTE - Also posted this bug here in
aldeed:collection2
. Wasn't sure which package it's rooted in. Will close in both once it's resolved.Describe the bug
Ran into an issue upgrading my project to Meteor 2.16 from 2.7.2 (on my way up to 3.0).
When using
aldeed:[email protected]
with the includedaldeed:[email protected]
on a Meteor 2.16 project along withmatb33:[email protected]
(latest version), using the collection hook'sdirect
versions that bypass a collection's hook will cause thedefaultValue
andautoValue
set in the schema to also not run. The added logic in the defined simple schema gets bypassed and the document gets inserted/updated as if simple schema doesn't exist. I have testedmatb33:collection-hooks
and it seems the problem is rooted inaldeed:collection2
oraldeed:simple-schema
. If you drop back down toaldeed:[email protected]
and usemeteor npm install [email protected]
with any version ofmatb33:collection-hooks
all works as expected.To Reproduce
I've hotrodded the React Simple Todos demo to display the error in a repo here.
The repo has the following currently added:
A link will be inserted in the list without using the
direct
version in theinsert
. Theinsert
is performed and the link'sdescription
andcreatedAt
are all successfully set using either Simple Schema'sdefaultValue
orautoValue
. You'll also notice the link'slinkType
is set to "video" by the defined and workingLinksCollection.before.insert
hook.A link will be inserted in the list using the
direct
version in theinsert
. Theinsert
is performed but the link will not get any of the Simple Schema logic (e.g.defaultValue
orautoValue
) however it does get inserted. And the hook is not performed so itslinkType
is still "website".Expected behavior
Making use of a
matb33:collection-hook
direct
call should still run the Simple Schema logic (e.g.defaultValue
orautoValue
) and validation. Usingaldeed:[email protected]
andmeteor npm install [email protected]
all works as expected. Feel free to comment outaldeed:collection2
and uncommentaldeed:[email protected]
in thepackages.js
file and then do ameteor npm install [email protected]
and then update theimport
inlinks.js
to see it working correctly on the prior versions.The text was updated successfully, but these errors were encountered: