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

Batch selection is not in sync between search results and record view. #8492

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

josegar74
Copy link
Member

@josegar74 josegar74 commented Nov 8, 2024

Fixes #8295

@fxprunayre the fix solves the issue, but there is another selection bucket (SELECTION_METADATA) that is used in 22 places:

public static final String SELECTION_METADATA = "metadata";

I have change EsHTTPProxy search methods to use SELECTION_BUCKET and update the value from bucket to s101. I haven't change EsHTTPProxy.msearch that still uses SELECTION_METADATA as I'm not sure if should be changed or not.

I would like to add some comment to SELECTION_METADATA describing it's usage.


Includes Sonarlint code improvements.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@josegar74 josegar74 added this to the 4.4.7 milestone Nov 8, 2024
@tylerjmchugh
Copy link
Contributor

The changes seem to fix the second case on #8295 but the first case still does not work.

Reproduction steps:

  • Submit a search
  • Open the record view for one of the results
  • Under "Manage record" select the "Add to the selection" checkbox
  • Click "Back to search"
  • The updated selection is not displayed until the page is refreshed.

batch

@josegar74
Copy link
Member Author

@tylerjmchugh right that problem is not related to the different selection bucket used on each place.

That's a user interface problem, and at the moment I'm not clear how to handle it. The button is based on browsing history, rather than doing a search.

@tylerjmchugh
Copy link
Contributor

@josegar74 Ok, in that case the proposed changes do solve the issue they were intended to fix. Looks good to me.

Copy link
Member

@fxprunayre fxprunayre left a comment

Choose a reason for hiding this comment

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

LGTM.

haven't change EsHTTPProxy.msearch that still uses SELECTION_METADATA as I'm not sure if should be changed or not.

So far we are not using selection with msearch endpoint so should be ok.

@fxprunayre fxprunayre merged commit 0fc0447 into geonetwork:main Nov 29, 2024
7 checks passed
@geonetworkbuild
Copy link
Collaborator

The backport to 4.2.x failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply ce0fa456df... Batch selection is not in sync between search results and record view.
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging core/src/main/java/org/fao/geonet/kernel/SelectionManager.java
CONFLICT (content): Merge conflict in core/src/main/java/org/fao/geonet/kernel/SelectionManager.java
Auto-merging services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java
CONFLICT (content): Merge conflict in services/src/main/java/org/fao/geonet/api/es/EsHTTPProxy.java

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.2.x 4.2.x
# Navigate to the new working tree
cd .worktrees/backport-4.2.x
# Create a new branch
git switch --create backport-8492-to-4.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick ce0fa456dfe9d8aae584f70f5660f7940a8ac48f
# Push it to GitHub
git push --set-upstream origin backport-8492-to-4.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.2.x

Then, create a pull request where the base branch is 4.2.x and the compare/head branch is backport-8492-to-4.2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batch selection is not in sync between search results and record view
4 participants