Bug in dat/list/by_alloc route
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Start at the dat/list/by_alloc route and inspect the else branch around the g_db._query call and the following result loop. Verify how the route behaves when that branch runs, then ensure the query result is an array and confirm the loop processes the route output without errors.
Written by the indexing model from the issue text.
Description
At the bottom of the route, if the else branch is triggered than an array is not being output this leads to problems in the for loop at the very bottom.
else{
qry += " return { id: v._id, title: v.title, alias: v.alias, owner: v.owner, creator: v.creator, size: v.size, md_err: v.md_err, external: v.external, locked: v.locked }";
result = g_db._query( qry, { repo: req.queryParams.repo, uid: owner_id });
}
for ( var i in result ){
doc = result[i];
if ( doc.id ){
doc.notes = g_lib.getNoteMask( client, doc );
}
}
The solution is to ensure the result is first converted to an array.
result = g_db._query( qry, { repo: req.queryParams.repo, uid: owner_id }).to_array();
- Dominant language
- JavaScript
- Stars
- 27
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ORNL/DataFed
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Type: Docs - User
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Component: Web UI SeenByJosh Track Externally Type: New Feature
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·