Skip to content

Restore produces error on client side with version 1.0.8 #29

Open
@kpala

Description

@kpala

Hi

After upgrading from 1.0.7 to 1.0.8, I get the following error when running restore on a client side collection:

I20180326-20:52:19.074(3)?   2) ... collection "after all" hook:
I20180326-20:52:19.074(3)?      Not permitted. Untrusted code may only remove documents by ID. [403]
I20180326-20:52:19.074(3)?   Error
I20180326-20:52:19.075(3)?       at throwIfSelectorIsNotId (packages/allow-deny.js?hash=17efd8167bebe1f2018f9c642d8000a549d1fe26:538:11)
I20180326-20:52:19.075(3)?       at FileCollection._callMutatorMethod (packages/allow-deny.js?hash=17efd8167bebe1f2018f9c642d8000a549d1fe26:462:7)
I20180326-20:52:19.075(3)?       at FileCollection.remove (packages/mongo.js?hash=7dae0d2bbf4992c92bbb005435b6ee27a23d13b2:698:19)
I20180326-20:52:19.075(3)?       at FileCollection.<anonymous> (packages/matb33_collection-hooks.js?hash=f1f87bc2e36c884177945d27780c5feac3f558c7:596:25)
I20180326-20:52:19.075(3)?       at FileCollection.collection.(anonymous function) [as remove] (packages/matb33_collection-hooks.js?hash=f1f87bc2e36c884177945d27780c5feac3f558c7:155:21)
I20180326-20:52:19.075(3)?       at Object.publicApi.restore (packages/hwillson_stub-collections.js?hash=78141e0344bdcbbb91197c8d81dee7964dd532d3:97:24)
I20180326-20:52:19.076(3)?       at Context.<anonymous> (app/app.js?hash=1f60b72a619b4be1e22017eff622999fe287c0fb:75355:21)
I20180326-20:52:19.076(3)?       at callFn (packages/practicalmeteor_mocha-core.js?hash=8beea7367d1e32321cbe94d562492c67d7ddc5d2:4359:21)
I20180326-20:52:19.076(3)?       at Hook.Runnable.run (packages/practicalmeteor_mocha-core.js?hash=8beea7367d1e32321cbe94d562492c67d7ddc5d2:4352:7)
I20180326-20:52:19.076(3)?       at next (packages/practicalmeteor_mocha-core.js?hash=8beea7367d1e32321cbe94d562492c67d7ddc5d2:4698:10)

I guess this is caused by localCollection.remove({}); (https://github.com/hwillson/meteor-stub-collections/blob/master/index.js#L35) which tries to clear the collection without providing identifiers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions