Parse-SDK-JS
Parse-SDK-JS copied to clipboard
Package-lock out of sync
New Issue Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am not just asking a question.
- [x] I have searched through existing issues.
- [x] I can reproduce the issue with the latest versions of Parse Server and the Parse JS SDK.
Issue Description
CI fails in various PRs with:
npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
Steps to reproduce
See https://github.com/parse-community/Parse-SDK-JS/runs/7474143947?check_suite_focus=true
Actual Outcome
Tests fail
Expected Outcome
Tests pass
Environment
Current alpha
n/a
Logs
n/a
Thanks for opening this issue!
- 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
@parse-community/js-sdk could someone take a look at this? The tests started to fail since recently. Regenerating the package-lock file repeatedly produces the following 3 failing tests:
1) Dirty Objects tracks dirty arrays
- Failed: 1 == 2
2) Dirty Objects tracks dirty objects
- Unhandled promise rejection: AssertionError [ERR_ASSERTION]: 1 == 2
3) Dirty Objects tracks dirty geo points
- Unhandled promise rejection: AssertionError [ERR_ASSERTION]: 5 == 10
See https://github.com/parse-community/Parse-SDK-JS/runs/7474143947?check_suite_focus=true
This could be an issue in the Parse JS SDK, but it may as well be an issue in the current Parse Server alpha branch, which is the branch that is used to run the Parse JS SDK tests.
I really can't work out why these tests are failing due to a new package-lock.
The failing tests allow Parse Object to set updated objects without having to call .save (tracks in memory).
const geo = new Parse.GeoPoint(5, 5);
const object = new TestObject();
object.set('location', geo);
await object.save()
geo.latitude = 10;
// do not have to call .set again
await object.save();
const query = new Parse.Query(TestObject);
const o = await query.get(object.id);
assert.equal(o.get('location').latitude, 10);
Not sure which dependancy would cause this.
Any ideas?
I really can't work out why these tests are failing due to a new package-lock.
I don't think the tests are failing due to the regenerated package-lock. It seems that resolving the package-lock issue only uncovered the failing tests.
You could either debug-step through the tests (do they pass locally and only fail remotely?), to investigate why they fail. Or you could just to back in the commit history to find the last commit where the tests pass, then look at the difference to the next commit.
Is this still an issue @mtrezza?
Yes, it is. I wasn't able to track this down. To replicate this:
- fork
alpha - delete
package-lock.json - run
npm i
The CI should then fail.
That may be related to the fact that synk and dependabot manipulate the package-lock file and we are now in a state where the current (manipulated) file is significant differently than the file when recreated. So we are now going with the current manipulated file and doing releases, but we should be able to recreate package-lock file at any point in time and have the CI pass.
After some tedious investigation, It seems like the issue is caused by Parse Server. CI is currently locked to the latest version, yet npm i causes it to fetch alpha.
It seems like the commit that causes the failure is here.
The PR that should fix this issue is here
🎉 This change has been released in version 3.5.0-alpha.4
🎉 This change has been released in version 3.5.0-beta.1
🎉 This change has been released in version 3.5.0