Skip to content

fix: avoid vsprintf ValueError in non-English notification locales#168

Merged
oleksandr-nc merged 1 commit into
mainfrom
fix/notification-vsprintf-error
May 26, 2026
Merged

fix: avoid vsprintf ValueError in non-English notification locales#168
oleksandr-nc merged 1 commit into
mainfrom
fix/notification-vsprintf-error

Conversation

@oleksandr-nc
Copy link
Copy Markdown
Contributor

In Notifier::prepare() for new_open_tickets, the plural message used %s as the counter placeholder. With %s, Nextcloud's L10N pipeline never sets %count% for Symfony's IdentityTranslator, so the imploded "singular|plural" translation is returned verbatim and vsprintf then trips on the extra %s — throwing ValueError for every non-English user and breaking the notifications API and mail cron until the rows are deleted from the DB.

Switching the counter to %n (the Nextcloud convention) lets the L10N layer pass %count% and pick the correct plural form before substitution.

Same bug pattern and fix as nextcloud/integration_github#197 / nextcloud/integration_github#203.

Use %n for the plural counter instead of %s in the "new open tickets"
message. With %s, Nextcloud's L10N pipeline never passes %count% to
Symfony's IdentityTranslator, so the imploded "singular|plural"
translation is returned verbatim and vsprintf trips on the extra %s
placeholders, breaking the notifications API and mail cron for every
non-English user.

Same bug pattern as nextcloud/integration_github#197.

Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
@oleksandr-nc oleksandr-nc merged commit f260992 into main May 26, 2026
16 checks passed
@oleksandr-nc oleksandr-nc deleted the fix/notification-vsprintf-error branch May 26, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant