ruby-grape / ruby-grape/grape-entity

Problems after update

Open
#131 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug?
Dominant language
Ruby
Stars
729
Forks
154
PR merge metrics
No merged PRs in 30d

Description

One of my projects is running stable with grape-entity 0.3.0. But as soon I update to 0.4.0 or higher some of my tests fail. The odd thing is that they fail randomly and it seems that the connection to MongoDB randomly fails. I'm getting errors like this:


Problem:
   Document(s) not found for class Project with id(s) 555b4d484fe53d4ad2000310.
 Summary:
   When calling Project.find with an id or array of ids, each parameter must match a document in the database or this error will be raised. The search was for the id(s): 555b4d484fe53d4ad2000310 ... (1 total) and the following ids were not found: 555b4d484fe53d4ad2000310.
 Resolution:
   Search for an id that is in the database or set the Mongoid.raise_not_found_error configuration option to false, which will cause a nil to be returned instead of raising this error when searching for a single id, or only the matched documents when searching for multiples.

If I downgrade to 0.3.0 all tests are green again.

Any idea what could be the reason?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failing tests while comparing grape-entity 0.3.0 with 0.4.0 and later, focusing on the reported MongoDB lookup failures. No files or tests are named in the issue; done means identifying the version regression and restoring consistently passing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, ruby
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.