Repository navigation
Conversation
…resigning Declining a weblog invitation now removes the permission only while it is still pending, so it can no longer remove an accepted membership. Resigning from a weblog is refused, with a message, when the user is the weblog's only admin; pending invitations do not count as another admin.
…bind name LdapCommentAuthenticator now escapes the submitted user name with Rdn.escapeValue before putting it in the uid part of the bind DN, so characters such as commas, plus signs and equals signs stay part of the user name.
…ing nothing WeblogSearchRequest and WeblogFeedRequest now keep only the first 256 characters of the q parameter, without splitting a surrogate pair. SearchOperation now catches runtime exceptions that Lucene throws for queries that parse but cannot be built or run, such as an unfinished regular expression or a negative phrase slop. It logs them as a warning and handles them the same way as a query that does not parse.
snoopdave
reviewed
Nov 18, 2026
…ed operation Resigning from a weblog and saving the Members page now go through UserManager.updateWeblogMembership(), which locks the weblog's row, reads its memberships again, and applies the changes in the same transaction only if an enabled administrator remains. Concurrent membership changes for a weblog therefore run one after the other and can't leave it without an administrator, and a disabled user who holds ADMIN no longer counts as one.
Removing a weblog or a user now also removes its pending invitations, so a weblog or user created later with the same name doesn't inherit them.
Contributor
Author
|
A second review raised a few more points, now addressed in the latest commits:
|
Removing a weblog now deletes its permission rows directly, so a member or invited user who has since been disabled no longer stops the removal with a NullPointerException. updateWeblogMembership changes the permission rows it read under the lock instead of revoking and granting through the user, which works for disabled members. A pending invitation whose role changes still stays pending, and a test now covers that. It also fails with "permission not found" when a change names a user who has no membership or invitation, so resigning from a weblog you don't belong to reports an error again rather than success. The Members page skips rows for disabled members when saving, since the form has no field that can address them, instead of failing every save on that weblog.
snoopdave
reviewed
Nov 20, 2026
snoopdave
left a comment
Contributor
There was a problem hiding this comment.
Review of ad9de0781: Resigning and the Members page now share updateWeblogMembership(), which locks the weblog row, re-reads memberships and applies the change in one transaction, so the earlier point is resolved. Disabled admins no longer count as the remaining administrator. One gap from #322 applies here too.
Earlier comments: 1 of 1 resolved.
The Members page named each row's radio buttons after the member's user id, which it got through WeblogPermission.getUser(). That lookup only finds enabled users, so a disabled member's row rendered with a blank name and a field the save could not match, and an admin could not remove the member or change their role. Each row is now keyed by its permission id and shows the user name stored on the permission, so save() no longer needs to look up the user. New page tests remove a disabled member and change a disabled member's role.
When the 256-character limit ends inside a quoted phrase, the search and feed requests now drop that phrase's opening quote, so the rest of the query still parses and finds entries instead of nothing.
updateWeblogMembership() now checks that every change is for a member of, or a user invited to, the weblog before it takes the weblog's row lock, and checks again once the lock is held. A request to resign from a weblog the user doesn't belong to now fails straight away instead of waiting for, and then holding, the lock. A database error while taking the lock or reading the memberships is reported as a WebloggerException, so the Members and Resign pages show their usual error message.
Members.save() counted the removals and changes while building the update, so a failed save showed "Removed 1 user(s)" next to "Error saving permissions". The counts are now cleared when the save fails.
Resigning chained to the main menu. When resigning was refused because the user is the weblog's only admin, the error carried over to the main menu, which has no input page, so the user got a "No result defined" error page instead of the message. Resigning now redirects to the main menu and keeps its messages across the redirect, as accepting and declining an invitation do. The redirect also ends the request as soon as the change is made or refused. Resigning with a weblog handle that doesn't exist now shows the access denied page instead of failing with an error.
…tespace The search query limit now skips an escaped quote when it looks for a phrase that the limit cuts off, and drops an escape character whose escaped character is cut off, so the capped query still parses. Leading and trailing whitespace is stripped before the limit is applied, so a query padded with spaces keeps its search terms.
The search operation caught every runtime exception as a query Lucene couldn't run and logged it as a one-line warning. It now catches only the exceptions Lucene throws for such queries and logs them at debug level, like a query that doesn't parse. Other failures, such as an index that can't be opened, are logged as errors with their stack trace again.
…y a member A main menu page loaded before an invitation was accepted still offers to decline it. Declining then said that the invitation was just revoked and logged an error with a stack trace. It now says that the user is already a member of the weblog and can resign to leave it.
The membership tests no longer revoke memberships before removing the weblog, since removing it now removes its invitations too. The permission test's cleanup revokes only memberships that are still there, so it can't hide the original failure.
…ship-and-search-6.1.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 6.1.x version of the membership, LDAP and search parts of #322. The OIDC identity part isn't included: on 6.1.x the OpenID URL is a field users edit by design.
As on #322, resigning and saving the Members page go through
UserManager.updateWeblogMembership(), which checks that each change is for a member or invitee, then locks the weblog's row and applies the change only if an enabled administrator remains, and removing a weblog or user also removes its pending invitations.Resigning now redirects to the main menu and keeps its messages with the
storeinterceptor, as accept and decline do. With the old chain result, a refused resignation carried its error intoMainMenu, whose workflow then looked for aninputresult and showed a "No result defined" error page.MemberResignResultTestruns the action through the Struts dispatcher.WeblogMembershipTest, PermissionTest, LdapCommentAuthenticatorTest, SearchMalformedQueryTest and SearchQueryLengthTest: 10 of the original 23 cases fail without the change.
The 6.1.8 CHANGES entries for this PR, added in #336, now also say that resigning redirects to the main menu, that declining an accepted invitation says you're already a member, and that spaces around a search query are dropped.
A further review pass added these fixes:
SearchOperationtreats only the exceptions Lucene throws for a query it can't run as a query error, logged at debug. Other failures are logged as errors, as before.yourWebsites.declineMember) instead of saying the invitation was revoked.