Bug 38988

Summary: If JobsNotificationMethod is not STOMP the about page shows as if there was a problem
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: AboutAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Pushed to main --- QA Contact: Nick Clemens (kidclamp) <nick>
Severity: normal    
Priority: P5 - low CC: david, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35655
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
This fixes the messages displayed in About Koha "Server information" and "System information" tabs, depending on whether the RabbitMQ service is running and the options for the JobsNotificationMethod system preference. Previously, an error message was shown in the system information tab when the "Polling" option was selected and RabbitMQ was not running, when it shouldn't have. Expected behavour: - RabbitMQ running: . STOMP option: message broker shows as "Using RabbitMQ", no warnings in the system information tab . Polling option: message broker shows as "Using SQL polling", no warnings in the system information tab - RabbitMQ not running: . STOMP option: message broker shows as "Using SQL polling (Fallback, Error connecting to RabbitMQ)", error message shown in the system information tab . Polling option: message broker shows as "Using SQL polling", no warnings in the system information tab
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on: 36655, 37260    
Bug Blocks:    
Attachments: Bug 38988: Make the polling use case be normal in about page
Bug 38988: Make the polling use case be normal in about page
Bug 38988: Make the polling use case be normal in about page

Description Tomás Cohen Arazi (tcohen) 2025-01-28 17:34:15 UTC
I'm not sure how bug 35655 ended up doing this, but it is not ok:

* If polling is selected, the `text-bg-warning` is picked, and in the STOMP case it is `text-bg-info`. Both are ok so should be displayed the same.
* In the `System information` section, you end up with the message about not being able to connect to the message broker. Which is a feature if you chose `polling` so no error at all.
Comment 1 Tomás Cohen Arazi (tcohen) 2025-01-28 18:06:02 UTC
Created attachment 177286 [details] [review]
Bug 38988: Make the polling use case be normal in about page

This patch makes choosing `polling` for the `JobsNotificationMethod`
system preference not be considered problematic or different than
`STOMP`.

To test:
1. In `KTD` make sure you have `STOMP` selected
2. Make sure rabbitmq is running:
   $ ktd --shell
  k$ sudo -s
   $ service rabbitmq-server start
3. Go to the about page, 'Server information'
=> SUCCESS: 'Using RabbitMQ' displayed
4. Stop rabbit
   $ service rabbitmq-server stop
5. Repeat 3
=> SUCCESS: Using Rabbit but fallback to polling
6. Go to the 'System information' tab
=> SUCCESS: Error message about the broker not functional
7. Choose 'polling'
8. Repeat 3
=> FAIL: It says 'Using SQL polling' but in bold face <.<
9. Repeat 6
=> FAIL: There's an error about the broker, which we explicitly asked
not to use <.<
10. Apply this patch
11. Repeat 3
=> SUCCESS: Nothing weird, 'Using SQL polling' displayed.
12. Repeat 6
=> SUCCESS: No weird error about the broker.
13. Switch to 'STOMP'
=> SUCCESS: Behavior is the same with/without rabbit running
14. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 David Nind 2025-01-29 10:29:48 UTC
Created attachment 177307 [details] [review]
Bug 38988: Make the polling use case be normal in about page

This patch makes choosing `polling` for the `JobsNotificationMethod`
system preference not be considered problematic or different than
`STOMP`.

To test:
1. In `KTD` make sure you have `STOMP` selected
2. Make sure rabbitmq is running:
   $ ktd --shell
  k$ sudo -s
   $ service rabbitmq-server start
3. Go to the about page, 'Server information'
=> SUCCESS: 'Using RabbitMQ' displayed
4. Stop rabbit
   $ service rabbitmq-server stop
5. Repeat 3
=> SUCCESS: Using Rabbit but fallback to polling
6. Go to the 'System information' tab
=> SUCCESS: Error message about the broker not functional
7. Choose 'polling'
8. Repeat 3
=> FAIL: It says 'Using SQL polling' but in bold face <.<
9. Repeat 6
=> FAIL: There's an error about the broker, which we explicitly asked
not to use <.<
10. Apply this patch
11. Repeat 3
=> SUCCESS: Nothing weird, 'Using SQL polling' displayed.
12. Repeat 6
=> SUCCESS: No weird error about the broker.
13. Switch to 'STOMP'
=> SUCCESS: Behavior is the same with/without rabbit running
14. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Nick Clemens (kidclamp) 2025-02-07 16:07:47 UTC
Created attachment 177638 [details] [review]
Bug 38988: Make the polling use case be normal in about page

This patch makes choosing `polling` for the `JobsNotificationMethod`
system preference not be considered problematic or different than
`STOMP`.

To test:
1. In `KTD` make sure you have `STOMP` selected
2. Make sure rabbitmq is running:
   $ ktd --shell
  k$ sudo -s
   $ service rabbitmq-server start
3. Go to the about page, 'Server information'
=> SUCCESS: 'Using RabbitMQ' displayed
4. Stop rabbit
   $ service rabbitmq-server stop
5. Repeat 3
=> SUCCESS: Using Rabbit but fallback to polling
6. Go to the 'System information' tab
=> SUCCESS: Error message about the broker not functional
7. Choose 'polling'
8. Repeat 3
=> FAIL: It says 'Using SQL polling' but in bold face <.<
9. Repeat 6
=> FAIL: There's an error about the broker, which we explicitly asked
not to use <.<
10. Apply this patch
11. Repeat 3
=> SUCCESS: Nothing weird, 'Using SQL polling' displayed.
12. Repeat 6
=> SUCCESS: No weird error about the broker.
13. Switch to 'STOMP'
=> SUCCESS: Behavior is the same with/without rabbit running
14. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Katrin Fischer 2025-02-13 14:32:36 UTC
Pushed for 25.05!

Well done everyone, thank you!