Version 4#379
Conversation
…feature/export-collections
And account for the new index creation method
|
@StorytellerCZ is there anything that isn't already implemented by the latest release that contains the async counterparts? |
|
Not 100% sure, but I think we have everything. I will remove the sync MongoDB calls in this branch. Or maybe for the client we can leave the sync methods? Thoughts? |
|
@StorytellerCZ I think it would make sense to leave sync methods for the client. This is consistent with other packages like Accounts isn't it ? Thanks |
|
Synchronous Mongo calls on the client side are alright in Meteor 3.0, IIRC. When is this PR expected to be merged in and published? I would love to test this in my application. |
|
Once this is merged: I will release a beta. |
|
I would suggest updating the For obvious reasons, the method needs to become async to be able to count how many records are in the collection. |
|
@dallman2 PRs welcome. |
30b4352 to
4bb9684
Compare
| }, options) | ||
|
|
||
| const result = Meteor.roles.upsert({ _id: roleName }, { $setOnInsert: { children: [] } }) | ||
| const result = RolesCollection.upsert({ _id: roleName }, { $setOnInsert: { children: [] } }) |
There was a problem hiding this comment.
This is breaking all our tests:
- If we directly replace
Meteor.Rolesit will not apply this internal collection. We also can no longer check if a role is created usingMeteor.roles.countDocuments - If we use
hwillston:stub-collectionswe can only test for integration and not manully stub specific methods for unit tests. This was possible whenMeteor.roleswas used.
There was a problem hiding this comment.
The Meteor.roles is still applied and unchanged, but you can now import he RolesCollection as well from the package. See roles_common_async.js.
There was a problem hiding this comment.
@jankapunkt please give this a look in the latest push, I have reverted to using the Meteor object for collection access.
|
@jankapunkt @harryadel can I get a check on this from you, so that we can do the release? Many thanks! |
|
Anything else for release? @jankapunkt @harryadel |
harryadel
left a comment
There was a problem hiding this comment.
Very few nitpicks, feel free to disregard if you don't agree.
Was missing subscription to get the data. Not sure why the sync client tests are able to still run. Maybe the data added persist in minimongo?
console.debugfor debugging messagesRolesCollectionandRoleAssignmentsCollectioncan now be exported in addition to being accessed viaMeteor.rolesandMeteor.roleAssignment