Comments (4)
Hi, sorry for the delay.
I agree that we should close our Response.Body
in production code. I have done it on the critical parts, like the connections to CouchDB, for the reasons you explain. But I have been more sloppy on other places.
I think one way we can advance on the subject could be:
- fix the production code
- enable the linter via another configuration file to disable running it on test files (temporary)
- work on the tests to use httpexpect (I agree it improves tests)
- when/if we can migrate all the tests, we can fusion the two configuration file for linters in one.
Are you OK with that?
from cozy-stack.
Hi 👋
My first message make the issue as terrible because the linter return a lot of errors but after a deeper look it seems that the linter have a lot of limitations. Id doesn't handle the body closed inside an another function.
So I totally agree with you plan, I had the same in mind but if we want to enable the linter in prod it would require to move the body closing next to the requests. This will make a lot of duplicate juste for making the linter happy.
Personnaly I think it's not terrible but it's still a good idea because this linter have a lot of value but this is your choice to make 😄
I will start to migrate the tests to httpexpect ASAP but it will take some time.
from cozy-stack.
It's done!
After a loooooong and tedious refactoring all the tests have moved on gavv/httpexpect
and we can better see the actual bodyclose
errors and hope to be able to activated soon.
Have a propose a bunch of PR which, once merged, should allow to enable the bodyclose
linter and ensure that no body have been leaved unclosed.
from cozy-stack.
Final note: It seems that there is far fewer body not close than what I have expected. 95% of them was inside the tests.
from cozy-stack.
Related Issues (20)
- I'm new here. Is there an easy way to update a self hosted cozy cloud instance?
- New Linux Foundation project needs an open source PDS
- Error when updating the permission's type
- Avanzar sistema .../034kjdqyteasbops)./> ..>
- exitAfterDefer issue
- nsjail Versus wasm HOT 3
- Discussion: `/public/avatar` and `/:sharing-id/recipients/:index/avatar` HOT 3
- Different behaviour between `POST /sharings` and `POST /sharings/` HOT 2
- Inconsistent error title HOT 2
- CI feature: integrate pull request preview environments
- Issues some implementations issues in `lock` package HOT 5
- Moving back from https://github.com/cozy/afero to https://github.com/spf13/afero? HOT 12
- Discussion: Code coverage integration? HOT 2
- Can't run integration tests HOT 2
- can't make cozy working behind cloudflared HOT 1
- New route GET /settings/bitwarden for consistency
- Docker doesn't work HOT 2
- Can't install cozy stack HOT 2
- FAIL TO SETUP Error: badly formated URL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cozy-stack.