jsreport / jsreport-core

The minimalist jsreport rendering core
GNU Lesser General Public License v3.0
86 stars 24 forks source link

Analyse if passing request object to store functions shouldn't be required #39

Closed pofider closed 4 years ago

pofider commented 5 years ago
reporter.documentStore.collection('foo').find({}, req?)

It is not required to pass the req object currently. This is error prone as devs can forget it.

I would propose to change it and make req object parameter required. In cases when it does make really sense to pass it without, dev should make it explicit. Something like

reporter.documentStore.collection('foo').findWithoutContext({})
pofider commented 4 years ago

I guess we learned to live with it. There are still calls that need a request like samples creations, scheduling, logs flush. @bjrmatos I would close this, what you think?

bjrmatos commented 4 years ago

for the moment yes, i guess we can live with it not being required, we were always able to handle the case just fine