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

JCRVLT-767: vlt: potential incorrect identifier comparison #348

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

reschke
Copy link
Contributor

@reschke reschke commented Aug 8, 2024

(work in progress)

This appears to work, except in Jackrabbit, which is unhappy about the sequence "setProperty( ... uid ...)" followed by "addMixing(mix:ref)".

@reschke reschke requested a review from kwin August 8, 2024 14:35
@reschke reschke marked this pull request as draft August 8, 2024 14:35
// if this is mix:ref and ni specifies an identifier,
// try to set it
try {
uuidProp = node.setProperty(Property.JCR_UUID, identifier.get());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the uuid already set through the sysview import?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we get here in case we skipped that...?

reschke added 2 commits August 9, 2024 07:35
…t fail on classic Jackrabbit by checking reh repo name desc as well)
boolean isUuidProtected = false;
if (node.hasProperty(Property.JCR_UUID)) {
isUuidProtected = node.getProperty(Property.JCR_UUID).getDefinition().isProtected();
} else if (! session.getRepository().getDescriptor(Repository.REP_NAME_DESC).contains("Oak")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why else if? Shouldn't this also overwrite isUuidProtected from line 995 potentially?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question; tests passed with Jackrabbit; will have another look

Copy link
Contributor Author

@reschke reschke Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might have to do with https://jackrabbit.apache.org/oak/docs/differences.html#Identifiers - but code is unclear and needs fixing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should better wirh 223bb00

if (! session.getRepository().getDescriptor(Repository.REP_NAME_DESC).contains("Oak")) {
// workaround for non-Oak repos that may not be able to add
// mixin:referencable *after* setting jcr:uuid
isUuidProtected = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointer; let's do more research on the "setting of jcr:uuid" first, and the outcome of that would inform what information we would want to add there.

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