There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-b41d11b5-93e1-47d3-a01b-c1f5e483edcf XWIKI-24621 Open

Notification watch settings can silently fail to be saved

 
View issue   ·   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-c8d086e2-197b-4a33-bc3a-da6cfb086c2a Vincent Massol on 25/Jul/26 15:52
 

Pull request: https://github.com/xwiki/xwiki-platform/pull/5968

It applies the fix proposed above: fail() instead of the removed jqXHR.error(), the second change of the combined options chained with then() in a performChainedChanges() helper instead of an already started request handed to pipe(), and truthy guards instead of the comparisons against the string 'undefined'.

Verified two ways:

  • With jQuery 4.0.0 and jQuery Migrate 4.0.2, the versions the platform ships, running the old and the new handler side by side against a real HTTP server. Before: TypeError: chain.error is not a function, both requests sent at the same millisecond, and the page reload firing at 37 ms while the space-level request only completed at 161 ms. After: no exception, the space-level request sent only once the page-level one had completed, the reload firing after both, and no JQMIGRATE message left. jqXHR.error and jqXHR.success are indeed undefined in that combination, while fail and done are functions.
  • mvn clean verify -pl xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-test/xwiki-platform-notifications-test-docker -Plegacy,docker,integration-tests -Dit.test=NotificationsSettingsIT, which covers the watch modal including the UNWATCH_PAGE_WATCH_SPACE combined option: 5 tests out of 6 pass. The 6th, watchAndRename:874, fails identically on unmodified master in the same environment (HSQLDB embedded, Jetty standalone, Firefox on macOS) – I ran the class twice, once with the fix and once with the master version of the file put back – so it is pre-existing and unrelated: that test never opens the watch modal.

The failure path itself (a request that does not succeed) has no automated test.