cheminfo / cheminfo/mass-tools

mf-parser: `MF.prototype.getInfo` can be incoherent on successive calls due to caching

Open
#232 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
9
Forks
0
Avg merge
1d 22h
Merged PRs (30d)
3

Description

```ts
const mf = new MF('Na+.Cl-');

// OK
expect(mf.getInfo().monoisotopicMass).toBe(57.958621964);

// error, undefined, because getInfo is cached in the instance
expect(mf.getInfo({emFieldName: 'test'}).test).toBe(57.958621964);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with MF.prototype.getInfo and reproduce the successive-call example from the issue. Trace how the instance cache handles the emFieldName option; done means both calls return the expected mass and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.