[ https://issues.apache.org/jira/browse/OAK-9891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marcel Reutegger resolved OAK-9891. ----------------------------------- Fix Version/s: 1.46.0 Resolution: Fixed > Removal (purge) of version of a node does not remove associated labels > ---------------------------------------------------------------------- > > Key: OAK-9891 > URL: https://issues.apache.org/jira/browse/OAK-9891 > Project: Jackrabbit Oak > Issue Type: Bug > Components: jcr > Reporter: Arun Kumar Ram > Assignee: Marcel Reutegger > Priority: Major > Fix For: 1.46.0 > > Attachments: > OAK-9891_removal_of_version_should_remove_associated_labels.patch > > Original Estimate: 48h > Remaining Estimate: 48h > > We have encountered a behavior of versionStorage and versionLabels which I > think is bug. > *Current behavior:* > > # Create a node and make it *versionable* > # Now create more than two versions (for example two version is *1.0* and > *1.1* respectively) > # Now add label at version 1.0 via *VersionHistory* Object (for example > label is {*}Label_1.0{*}) > # Now remove the version 1.0 via calling *removeVersion(1.0)* method of > *VersionHistory* object > # Now call method *hasVersionLabel(Label_1.0)* of versionHistory . its now > returning true. > > *Expected behaviour:* > Call to the *hasVersionLabel(Label_1.0)* of *versionHistory* should not > return true because version associated with label does not exist. And > removing the version should remove associated labels. > > If we say that *hasVersionLabel(Label_1.0)* of *versionHistory* returning > true is expected behavior because label is not removed. Then call to the > function getVersionByLabel({*}Label_1.0) of versionHistory{*} will ** throw > VersionException because version does not exist. So the repository goes into > inconsistent state. > *Solution proposal:* > One of the solution can be that whenever consumer of versionHistory removes > the version , he should be forced to remove the versionLabel first by > throwing LabelExistException > > Another solution can be we should remove version label whenever user removes > the version. > -- This message was sent by Atlassian Jira (v8.20.10#820010)