Skip to content

Updated FileKeystore field not disabled when SSL Property is not enabled#15661

Closed
gandhroh000 wants to merge 22 commits into
JabRef:mainfrom
gandhroh000:fix_to_Database_Login_Dialog_KeyStore_field_enabled
Closed

Updated FileKeystore field not disabled when SSL Property is not enabled#15661
gandhroh000 wants to merge 22 commits into
JabRef:mainfrom
gandhroh000:fix_to_Database_Login_Dialog_KeyStore_field_enabled

Conversation

@gandhroh000

@gandhroh000 gandhroh000 commented May 3, 2026

Copy link
Copy Markdown
Contributor

Related issues and pull requests

Closes #15660

PR Description

In the "Connect to Shared Database" page, when the "Use SSL" checkbox was deselected, fileKeyStore would still be showing as a required field, which can be confusing to the user. For reference, only when the SSL connection checkbox is enabled, the fileKeyStore field would be enabled. To change this, it was necessary to add a condition to the SharedDatabaseLoginDialogView. java file that triggered the disabledProperty function, hiding the fileKeyStore entry field.
image

Steps to test

  1. Open a local copy of this version which has the UI change implemented
  2. Once the JabRef application is open, select the File button in the upper left hand corner
  3. Once the dropdown menu has expanded, click on the "Connect to shared database"
  4. Once the Shared Database Page has opened, attempt to click the the SSL connection checkbox
  5. Clicking the "Use SSL" checkbox (check box is filled with a checkmark and green color) will visually change the color of the fields (KeyStore, Browse Button, and KeyStore password) to a brighter color.
  6. When the "Use SSL" checkbox is enabled, this will allow the reviewer to interact with the fields aformentioned fields.
  7. When the "Use SSL" checkbox is disabled (check box is not filled with a green color and checkmark), the fields mentioned will dim in brightness, and will not allow interaction.

Disabled "Use SSL" button:
image
Enabled "Use SSL" button:
image

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [/] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label May 3, 2026
@gandhroh000 gandhroh000 marked this pull request as ready for review May 3, 2026 01:41
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix fileKeystore field disabled state in Shared Database Login

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Disable fileKeystore field when SSL is not enabled
• Ensures consistent UI behavior across SSL-related fields
• Updated changelog to document the fix
Diagram
flowchart LR
  SSL["SSL Property"] -- "not enabled" --> Disable["Disable Fields"]
  Disable --> FileKeystore["fileKeystore Field"]
  Disable --> Browse["Browse Button"]
  Disable --> Password["Password Field"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java 🐞 Bug fix +1/-0

Bind fileKeystore disable property to SSL state

• Added binding to disable fileKeystore field when SSL is not enabled
• Aligns fileKeystore disable behavior with browseKeystore and passwordKeystore fields
• Ensures consistent UI state across all SSL-dependent fields

jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java


2. CHANGELOG.md 📝 Documentation +1/-0

Document fileKeystore field disable fix

• Added entry documenting the fix for Shared Database Login Dialog
• References issue #15660 for field requirement consistency

CHANGELOG.md


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0)

Context used

Grey Divider


Remediation recommended

1. Changelog entry too technical 📘 Rule violation ⚙ Maintainability
Description
The added CHANGELOG entry is not written in clear, end-user-friendly language and contains awkward
phrasing (e.g., "respective to"), reducing professionalism and readability. This violates the
requirement that CHANGELOG entries be polished and appropriate for the average user.
Code

CHANGELOG.md[104]

+- We fixed the Shared Database Login Dialog by ensuring that fields were required or not required respective to connection information and preferences. [#15660](https://github.com/JabRef/jabref/issues/15660)
Evidence
PR Compliance requires CHANGELOG.md entries to be user-focused and professionally written. The newly
added entry uses unclear/technical wording and unpolished grammar, which does not meet those
documentation quality expectations.

AGENTS.md
CHANGELOG.md[104-104]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly added `CHANGELOG.md` entry is unclear/overly technical and contains awkward phrasing; it should be rewritten to be user-facing and professionally worded.

## Issue Context
CHANGELOG entries are user-facing documentation and should be easy to understand for average users.

## Fix Focus Areas
- CHANGELOG.md[104-104]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Keystore validated when SSL off 🐞 Bug ≡ Correctness
Description
The keystore validator requires a non-empty existing path regardless of SSL state, and the view
subscribes to useSSL in a way that runs the keystore validation visualization even for the current
(unchecked) value. As a result, the keystore can still be treated/visualized as invalid/required
while SSL is disabled.
Code

jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java[134]

+        fileKeystore.disableProperty().bind(viewModel.useSSLProperty().not());
Evidence
The PR disables the keystore field when useSSL is false, but the keystore validation itself is
unconditional: keystoreValidator checks notEmptyAndfilesExist and does not incorporate useSSL.
Additionally, EasyBind.subscribe(...) invokes the subscriber for the current value, so the
keystore visualization hookup runs even when SSL starts unchecked, which is inconsistent with
“keystore required only when SSL is enabled.”

jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java[126-152]
jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java[125-140]
jabgui/src/main/java/org/jabref/gui/util/BindingsHelper.java[173-179]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The keystore field is disabled when `useSSL` is unchecked, but `keystoreValidator` still validates unconditionally and the view wires up visualization via `EasyBind.subscribe`, which runs immediately for the current (unchecked) value. This keeps the keystore in an invalid/required state even when SSL is off.

### Issue Context
Goal: keystore should only be considered required/validated when `useSSL` is enabled.

### Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogViewModel.java[125-140]
- jabgui/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java[126-152]

### Suggested fix
- Change keystore validation to depend on both `useSSL` and `keystore` so that when `useSSL == false`, the keystore validation is **valid**.
 - For example, create an `ObservableValue<Boolean>` using `EasyBind.combine(keystore, useSSL, (ks, ssl) -> !ssl || (nonEmptyAndExists(ks)))` and validate that boolean.
- Ensure validation status updates when toggling SSL (by making the validator observe `useSSL` via `EasyBind.combine`, rather than only observing the keystore text).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Do not mark a PR as ready-for-review if changes are required.
Address the changes first.

@koppor koppor marked this pull request as draft May 3, 2026 01:42
@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels May 3, 2026
@Siedlerchr

Siedlerchr commented May 3, 2026

Copy link
Copy Markdown
Member

Can you please take a look a the QODO comment? Is that a valid point?
The second point

@gandhroh000

Copy link
Copy Markdown
Contributor Author

Can you please take a look a the QODO comment? Is that a valid point? The second point

Yes, you are right thanks for pointing that out, I looked further into it and saw that since keyStoreValidator depends on the useSSL property, it wasn't added as a form validator, even though initialized. I made an additional predicate that incorporated both the notEmptyAndfilesExist and then added to the form validator.

However, I see an additional related issue with the folderValidator or automatically saving the library to field that saves the .bib file accordingly. This validator isn't added either to the form validator, and so with this fix it's about 3 lines of changes to the related issue of improve the Shared Database Login Dialog page, so I would also like to update that as well.

@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels May 3, 2026
@Siedlerchr

Copy link
Copy Markdown
Member

you can ignore the rewrite action for the moment, we are working on a fix in other PR

@Siedlerchr

Copy link
Copy Markdown
Member

can you please fix the merge conflicts? I think it was coming from the openrewrite

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pulling this from the main branch causes issues, as "eol variable" is no longer declared, and then causes declaration issues. Not sure if the rest of the eol was intended to be removed, but would need this to be fixed prior to fixing merge conflicts.

@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels May 5, 2026
@jabref-machine

Copy link
Copy Markdown
Collaborator

JUnit tests of jabsrv are failing. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Source Code Tests / Unit tests (pull_request)" and click on it.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels May 5, 2026
@gandhroh000

Copy link
Copy Markdown
Contributor Author

Main changes were to the UI, but it seems like OpenRewrite and other changes in the main branch are causing further issues. Would it be advised to close this pull request, pull from the most updated branch, commit new changes, and then reopen this pull request?

@gandhroh000

Copy link
Copy Markdown
Contributor Author

Closing this PR as the main branch fork wasn't synced, causing further issues. Will reopen PR with the same request; however, it will be with the updated repo.

@gandhroh000 gandhroh000 closed this May 5, 2026
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

This pull requests was closed without merging. You have been unassigned from the respective issue #15660. In case you closed the PR for yourself, you can re-open it. Please also check After submission of a pull request in CONTRIBUTING.md.

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

Labels

status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared Database Login Dialog - Keystore Field Not Disabled when "Use SSL" Box Disabled

3 participants