Skip to content
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

fix: lost RxDocument in preSave from v14.0.0 #4581

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

scriptsman
Copy link
Contributor

@scriptsman scriptsman commented Mar 22, 2023

This PR contains:

  • A BUGFIX

Describe the problem you have without this PR

// series
myCollection.preSave(function(plainData, rxDocument){
    // rxDocument is always undefined in the latest version
    console.log(rxDocument)
    // modify anyField before saving
    plainData.anyField = 'anyValue';
}, false);

https://rxdb.info/middleware.html

Todos

  • Tests

@pubkey
Copy link
Owner

pubkey commented Mar 22, 2023

Thank you for the fix. We also need a test to ensure this does not break.

Signed-off-by: scriptman <scriptmanxx@gmail.com>
@scriptsman
Copy link
Contributor Author

scriptsman commented Mar 25, 2023

Thank you for the fix. We also need a test to ensure this does not break.

Done. And I think we should pass the argument in the type of RxDocumentData instead of RxDocument.

@scriptsman scriptsman closed this Mar 25, 2023
@scriptsman scriptsman reopened this Mar 25, 2023
@scriptsman
Copy link
Contributor Author

@pubkey Is there anything else I have to check? And when can this PR be merged? I need to fix this issue as soon as possible.

@pubkey pubkey merged commit 1368d8f into pubkey:master Mar 30, 2023
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