Skip to content

(Not so) Minimal reproduction of an (possible) error happening within the Client side Remove operation of FileCollection Meteor package

Notifications You must be signed in to change notification settings

RaniereSouza/meteor-fc-cli-rmv-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meteor-fc-cli-rmv-problem

(Not so) Minimal reproduction of an (possible) error happening within the Client side .remove() operation of FileCollection Meteor package

(refers to Issue #152 from the Meteor Atmosphere package vsivsi:file-collection)

To reproduce the error, just do the following steps:

  1. Clone this repository to your machine;
  2. Run the application with the command meteor, as normal;
  3. Go to the browser, on http://localhost:3000/, and Add more than one Event with a Banner image;
  4. Choose any of the Events with a Banner image, and Edit it (Change or Remove the Banner);

EXPECTED: When Changing or Removing the Banner, the application should Remove the previous Banner from the FileCollection (Images), and only this file.
RESULT: ALL the files from FileCollection (Images) are Removed (it can be confirmed in the MongoDB shell, running meteor mongo and looking at the images.files Collection).

The lines where the .remove() operation is executed are highlighted at lines 144 and 191 from the file client/components/eventsForm.js

UPDATE: The error was tracked down by @vsivsi as a problem with the combined use of the package vsivsi:file-collection and the package dburles:collection-helpers (classifying it as an undesired Feature Interaction problem - look here for more details about what Feature Interactions are). Basically, the dburles:collection-helpers overwrite some basic Mongo.Collection methods when you assign a collection helper, and it breaks the .remove() operation on the FileCollection. See this Issues page for a more detailed explanation.

UPDATE: A temporary solution was uploaded in the problem_solved branch. It just doesn't assign any collection helper to the FileCollection anymore. The thing is, this problem can potentially be happening in ANY collection, as in the tests some operations from a regular Mongo.Collection returned wrong values when it was assigned a collection helper. In that case, the problem would be classified as a Feature Interaction between Meteor's base Mongo.Collection instance and the package dburles:collection-helpers. This has yet to be confirmed.

About

(Not so) Minimal reproduction of an (possible) error happening within the Client side Remove operation of FileCollection Meteor package

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published