camicroscope / Caracal

Conslidated Backend, Auth, and Security Services for caMicroscope
GNU General Public License v3.0
15 stars 95 forks source link

Add service for single point of interaction with database #90

Closed YashKumarVerma closed 3 years ago

YashKumarVerma commented 3 years ago

Summary

There are three issues linked with the project, here's a summary of what this PR accomplishes.

Details

Motivation

Testing

Questions

birm commented 3 years ago

Have you done any other configuration changes compared to the defaults in develop.yml? I can't get it to read from mongo at all.

YashKumarVerma commented 3 years ago

just checked, the problem was that the connector function was appending mongodb:// in the passed connection string from process.env, fixing it

YashKumarVerma commented 3 years ago

Hello there, is there something that I can improve in the PR ??

birm commented 3 years ago

I'm still not getting any results from any of the find endpoints despite data being in the database. Similarly, posting slide metadata doesn't update the mongo collections or the backend's slide/find route's results. If you've done the usual test (add slide, view slide, delete slide) successfully, then perhaps there's something more deeply different than expected about our environments or something of the sort.

YashKumarVerma commented 3 years ago

Changelog:

@birm could you please try the changes and see what tests fail on your end. I'm afraid there might be some particulars that are different on my local setup.

As of now, I'm facing issues in getting a smooth running distro instance on my machine, therefore cannot test the service with /caracal codebase.

https://i.imgur.com/R90uy51.png

YashKumarVerma commented 3 years ago

So I tried debugging the issue, isolated the service, and tested it, but couldn't find the area of the problem.

Then I did the following, based on routes.json, created a postman collection of the endpoints that operate on database actions.

image

The endpoints were behaving as expected, but there was one patten: the listing route was not working.

The problem was a simple typo in dataHandler that was calling mongo.add in place of mongo.find

The tests I wrote were testing the service, but the handler, therefore it was not detected in the tests.

YashKumarVerma commented 3 years ago

I've deployed my fork at:http://yashkumarverma-workbench.uaenorth.cloudapp.azure.com:4010/apps/table.html

YashKumarVerma commented 3 years ago

@birm ping :)

YashKumarVerma commented 3 years ago

Thanks! meanwhile got to learn a lot about the project ⭐