This issue has been created
There are 2 updates, 1 comment.
 
 
Book Versions / cid:jira-generated-image-avatar-710904a3-e6b2-4769-9123-1a3c0259623f BVERSION-236 Open

Installing / upgrading the application can bring the instance down

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-a897113c-6f6b-43fb-a8d7-236412a9aad0 Raluca Stavro created this issue on 18/Jul/25 16:48
 
Summary: Installing / upgrading the application can bring the instance down
Issue Type: cid:jira-generated-image-avatar-710904a3-e6b2-4769-9123-1a3c0259623f Bug
Affects Versions: 1.23
Assignee: Unassigned
Created: 18/Jul/25 16:48
Priority: cid:jira-generated-image-static-critical-33170779-b1ed-4508-b3d0-e8778a5dbc51 Critical
Reporter: Raluca Stavro
Description:

The cause is around https://github.com/xwiki-contrib/book-versions/blob/c81acdd94aa054388e27d1e6d908e12f05406376/application-book-versions-api/src/main/java/org/xwiki/contrib/bookversions/internal/PublishBookRightInitializer.java#L89 and it is related to the fact that every Right has a value, and that value needs to be below 64 because of the way we store right sets. And when you unregister a right that is not the last registered right, you break that whole system. So, basically, unregistering of rights is only supported when you unregister the last registered right. Plus, the values that are associated with rights need to be continuous.

 
 

2 updates

 
cid:jira-generated-image-avatar-a897113c-6f6b-43fb-a8d7-236412a9aad0 Changes by Raluca Stavro on 18/Jul/25 16:49
 
Description: The cause is around [ https://github.com/xwiki-contrib/book-versions/blob/c81acdd94aa054388e27d1e6d908e12f05406376/application-book-versions-api/src/main/java/org/xwiki/contrib/bookversions/internal/PublishBookRightInitializer.java#L89 ] and it is related to the fact that every Right has a value, and that value needs to be below 64 because of the way we store right sets are stored . And when you unregister a right that is not the last registered right, you break that whole system. So, basically, unregistering of rights is only supported when you unregister the last registered right. Plus, the values that are associated with rights need to be continuous.
Assignee: Raluca Stavro
 
 

1 comment

 
cid:jira-generated-image-avatar-a897113c-6f6b-43fb-a8d7-236412a9aad0 Raluca Stavro on 18/Jul/25 16:48
 

The workaround is to :

1. Not unregister the right.
2. Only register the right when it hasn't been registered yet. The actual right is not tied to the PublishBookRight instance in any way so there shouldn't be any problem that the PublishBookRight instance isn't the same anymore.

The only side effect is that uninstalling the extension won't remove the right from the UI anymore, but it will be gone after the next restart.

The only problem could be if someone wants to change any properties of the right, but even in that case it might be totally acceptable that the updated properties are only applied on the next restart.