Skip to content

Create migration-bug.test.ts #7261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alpha-2000
Copy link

This PR contains:

Steps:

  • Insert document with v1 schema
  • Replicate and update via inputstream before migration
  • Migrate to v2 schema and replicate again
  • Verify correct document state after each step
  • schow wath after make a local update to the doc after migration fixes the problem

Describe the problem you have without this PR

this adds a test for the bug described in #7260

this adds a test for the bug described in pubkey#7260

Steps:
- Insert document with v1 schema
- Replicate and update via inputstream before migration
- Migrate to v2 schema and replicate again
- Verify correct document state after each step
- schow wath after make a local update to the doc after migration 
fixes the problem
@pubkey
Copy link
Owner

pubkey commented Jul 1, 2025

Shouldnt this fail to reproduce your bug?

@alpha-2000
Copy link
Author

Yes, Case 2 fails. That's the bug. Cases 1 and 3 only serve to demonstrate the normal intended behavior and show that nothing else is wrong with the test scenario.

@alpha-2000
Copy link
Author

After transpiling I started with the following:
npx cross-env DEFAULT_STORAGE=memory npx mocha ./test_tmp/unit/migration-bug.test.js or
npx cross-env DEFAULT_STORAGE=dexie npx mocha ./test_tmp/unit/migration-bug.test.js
and for both storage layers 1 and 3 are successful and 2 fails as intended

@pubkey
Copy link
Owner

pubkey commented Jul 2, 2025

Can you make it fail in the CI?

@pubkey
Copy link
Owner

pubkey commented Jul 7, 2025

Hi, it seems that your 3 test cases do not run independently. Only if the first one is running, the should update document via replication stream AFTER migration fails. Please create a single minimal test which reproduces exactly what is failing.

@pubkey
Copy link
Owner

pubkey commented Jul 7, 2025

Ok I could reproduce, working on a fix.

@alpha-2000
Copy link
Author

Hi Daniel,

I hope you’re doing well!

I wanted to kindly ask if you have an idea when the bugfix might be merged.
I created this pull request with a test case about three days ago (thank you for reviewing!), but the issue itself has been affecting my workflow for about two weeks now.

At the moment, I’m unable to release a new version of my app, since all recent builds are affected by this bug.
I understand everyone is busy, and I really appreciate your hard work! If you could let me know roughly how long it might take until a fix is available, I’d be very grateful—this would help me to plan my next release.

Thank you so much in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants