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

XWIKI-22782: Only save modified xobjects #3798

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmortagne
Copy link
Member

@tmortagne tmortagne commented Jan 14, 2025

Jira URL

https://jira.xwiki.org/browse/XWIKI-22782

Changes

Description

  • added a flag to track if a BaseObject was modified
  • made sure that any modification of something in that BaseObject (properties, direct metadata of that object) update this flag
  • when saving the document skip any BaseObject which indicate that it was not modified
  • had to do some Serializable cleanup (revapi was getting a bit lost). It's not even clear to me what BaseElement and its derivatives are Serializable in the first place, but that's another story…

Clarifications

The general idea is to try to reduce the useless requests during document save. This pull request is focusing in making sure we don't re-save xobject which are identical to what's in the database already.

The save side of things is the easy part, most of the changes in the pull request are about trying to make sure we properly track modifications made to objects.

Executed Tests

Counting on existing test to validate that at least there is no regression.

TODO: various unit tests to check the behavior of the new BaseObject (actually BaseElement, since BaseObject is not the only element with this concept) dirty flag.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches: stable-16.10.x

@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch 2 times, most recently from e13046d to 009d360 Compare January 15, 2025 09:30
@tmortagne tmortagne self-assigned this Jan 15, 2025
@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch 2 times, most recently from e6f82cc to 1b98e9e Compare January 22, 2025 10:33
@tmortagne tmortagne force-pushed the feature-deploy-xobjectdirty branch from 1b98e9e to 081a360 Compare January 22, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants