Bitbucket Data Center: Merge check for unresolved conversations

Hi, I’m currently developing a merge check that counts the unresolved threads of a PR.
This works, but is only refreshed after CTRL-R.
In contrast, the resolved comments (tasks) are refreshed instantly.
Could it be that there is no event for the resolution of a thread? Why could it be that there is no refresh?

My code is like this

@Nonnull
	@Override
	public RepositoryHookResult preUpdate(@Nonnull PreRepositoryHookContext context,
		@Nonnull PullRequestMergeHookRequest request) {

	PullRequest pr = request.getPullRequest();
		
	AtomicInteger count = new AtomicInteger();

	CommentSearchRequest search = new CommentSearchRequest.Builder(pr).build();
	Page<CommentThread> threads = comments.searchThreads(search, new PageRequestImpl(0, 100000));
	threads.forEach(t -> {
		if (!t.isResolved()) {
			count.incrementAndGet();
		}
	});

	if (count.get() != 0) {
		return RepositoryHookResult.rejected("Rejected",
				"Not all conversations have been resolved (" + count.get() + ")");
	}
	return RepositoryHookResult.accepted();
}
1 Like

When the frontend detects that the task count has reached 0, it makes a new REST request to check the PR’s mergeability, which is why it seems to refresh instantly.
The frontend doesn’t do that when resolving/unresolving a thread.

Is there a way to force the refresh via a plugin?
Do you plan to fire this event in a future version or could I file a CR?

1 Like

Is there a way to force the refresh via a plugin?

It might be possible through a client-side extension, but I’m not certain sorry: Getting Started - Client-side Extensions

Do you plan to fire this event in a future version

Probably not since we don’t have resolved threads as a merge check.

or could I file a CR?

If you mean a BSERV ticket/suggestion, feel free to create one

@StanleySu Which board would that be? How would I do this? Could you post a link to an exemplary ticket?