Parse-SDK-JS icon indicating copy to clipboard operation
Parse-SDK-JS copied to clipboard

Package-lock out of sync

Open mtrezza opened this issue 3 years ago • 5 comments

New Issue Checklist

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

mtrezza avatar Jul 22 '22 19:07 mtrezza

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.

mtrezza avatar Jul 22 '22 19:07 mtrezza

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?

dblythy avatar Jul 26 '22 11:07 dblythy

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.

mtrezza avatar Jul 26 '22 23:07 mtrezza

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.

mtrezza avatar Jul 27 '22 12:07 mtrezza

Is this still an issue @mtrezza?

dblythy avatar Sep 08 '22 01:09 dblythy

Yes, it is. I wasn't able to track this down. To replicate this:

  1. fork alpha
  2. delete package-lock.json
  3. 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.

mtrezza avatar Sep 08 '22 22:09 mtrezza

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

dblythy avatar Sep 10 '22 03:09 dblythy

🎉 This change has been released in version 3.5.0-alpha.4

parseplatformorg avatar Sep 21 '22 20:09 parseplatformorg

🎉 This change has been released in version 3.5.0-beta.1

parseplatformorg avatar Oct 25 '22 22:10 parseplatformorg

🎉 This change has been released in version 3.5.0

parseplatformorg avatar Nov 01 '22 21:11 parseplatformorg