Repository navigation
Add user preference for the missing visible signature warning #8322
Description
Context
Part of #8321.
LibreSign will warn a requester when one or more signers have no visible signature field.
The requester can choose not to see this warning again.
LibreSign already has a generic API to save user configuration. This issue only needs to add the new preference to the existing user configuration flow.
Preference
Add this user configuration key:
warn_without_visible_signature_fields
The value controls only whether the warning is shown.
Expected values:
1: show the warning;0: do not show the warning.
When the user has no saved value, the default must be 1.
This preference must not change signature fields, signature positions, requests or signing behavior.
Backend changes
Reuse the existing endpoint:
PUT /apps/libresign/api/v1/account/config/{key}
Do not create a new controller or endpoint.
The existing endpoint already stores values for the authenticated user.
Update AccountService::getConfig() so the frontend receives:
{
"warn_without_visible_signature_fields": true
}when the warning is enabled, and:
{
"warn_without_visible_signature_fields": false
}when it is disabled.
If no value is stored, return true.
Follow the same pattern already used by boolean user settings such as:
files_list_grid_view;policy_workbench_catalog_compact_view;policy_workbench_catalog_collapsed.
Do not add a system policy or group configuration.
Reset behavior
The existing user-config API uses an empty value to remove/reset a user setting.
For this preference, resetting the value must restore the default:
warn_without_visible_signature_fields = true
No migration is needed because this is a new preference and the default applies when no value exists.
Behat tests
Update:
tests/integration/features/settings/user-config.feature
This file already tests save, update and delete behavior for user configuration keys.
Add warn_without_visible_signature_fields to the existing CRUD scenario.
Cover:
- save
0and confirm the API accepts it; - update it to
1; - reset it with an empty value;
- confirm the returned user configuration uses the default
trueafter reset.
Keep the existing test style instead of creating a separate feature file.
If the existing scenario already covers authentication for this endpoint, do not duplicate that test only for this key.
Unit tests
Update the existing AccountService unit tests for getConfig().
Cover at least:
- stored
1returnstrue; - stored
0returnsfalse; - no stored value returns the default
true.
Use a data provider if it keeps these cases small and clear.
Quality
Run the related backend checks and tests.
At minimum:
- the affected PHPUnit tests;
tests/integration/features/settings/user-config.feature;- Psalm;
- PHPCS.
Do not change unrelated user configuration behavior.
Good first issue
This is a small backend change using an existing LibreSign user configuration API.
The main work is:
- add one user configuration key to
AccountService::getConfig(); - reuse the existing
/account/config/{key}endpoint; - extend the existing PHPUnit tests;
- extend
tests/integration/features/settings/user-config.feature.
No new database table, migration, controller or policy is needed.
Please follow the existing user configuration patterns and keep the change focused.
Additional context
- If you have questions, feel free to ask in this issue.
- Give a ⭐️ star to this repository if you find LibreSign useful and would like to support the project.
- You can also join our community: https://t.me/LibreSign
Done when
-
warn_without_visible_signature_fieldsis available in user config. - The default value is
true. -
0is returned asfalse. -
1is returned astrue. - Resetting the stored value restores the default.
- The existing user-config API is reused.
- PHPUnit covers the value mapping and default.
- Behat covers save, update and reset.
- Psalm and PHPCS pass.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Start date
Target date
Projects
- StatusShow more project fieldsNo status
Activity
[-]Store the missing visible signature warning preference per user[/-][+]Add user preference for the missing visible signature warning[/+]maia-andre commentedon Sep 11, 2026
I took this one and opened #8349.
Two things worth your attention, both reported in the pull request.
The default needed a different mapping than the pattern you pointed at.
files_list_grid_view,policy_workbench_catalog_compact_viewandpolicy_workbench_catalog_collapsedall usegetUserConfigByKey(...) === '1', andgetUserConfigByKey()returns''when nothing is stored, so that expression defaults tofalse. This preference defaults totrue, so it maps with!== '0': only an explicit0hides the warning, and the empty value used to reset restores the default. Implementing it with=== '1'fails the new test on exactly the default case, so the distinction is guarded rather than assumed.One Behat item is covered by PHPUnit instead, and I would rather flag it than skip it quietly. Item 4 of your test list asks to confirm the returned user configuration uses the default
trueafter reset, but no OCS endpoint exposesAccountService::getConfig():/account/mereturnsgetSettings(), andgetConfig()only reaches the frontend throughinitialStateinPageController, which Behat does not read. So Behat covers the API contract — save0, update to1, reset with an empty value, in the existing CRUD scenario — and the default after reset is asserted in the unit test, where the mapping lives. If you would prefer an endpoint that exposes the user config so Behat can assert it end to end, that is a larger change and I would open it as its own issue.Local results:
AccountServiceTestOK with 36 tests and 86 assertions, psalm unchanged at 4 pre-existing errors, PHPCS clean. Behat was left to CI becausetests/integrationhas no vendor installed locally.Backport note: the cherry-pick applies cleanly to
stable35only. Onstable32,stable33andstable34getConfig()still ends with a barearray_filter($info), which drops falsy values — the key would disappear from the payload when a user disables the warning, which is the opposite of the intended behaviour.vitormattos commentedon Sep 11, 2026
Thanks for checking these details and explaining them clearly.
The
!== '0'mapping makes sense here because this preference must default totrue.For the Behat coverage, I agree with keeping the test on the existing API behavior and covering the default value in the
AccountServiceunit test. I don't think we should add a new endpoint only to make this assertion end to end.For the backport, since this preference is part of the new #8321 feature, let's keep it on
mainonly and introduce the complete feature from Nextcloud 36.feat(account): add the missing visible signature warning preference
feat(preferences): add the visible signature warning switch to user p…