Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64342

Messaging: Only make ajax request when privacy setting is changed, not per click

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.1, 3.7
    • Fix Version/s: 3.6.4
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      1. Test in 3.6 and master.
      2. Site-wide messaging enabled ('messagingallusers' is the setting name).
      3. Use a browser with Web developer tools like Firefox (Web developer) or Chrome (Developer Tools).

      Tests

      1. Log in as an admin
      2. Go to Messages Privacy preferences.
      3. Check you can see three options in Privacy settings:
        • My contacts only
        • My contacts and anyone in my courses
        • Anyone on the site
      4. Open a Web developer tools in your browser (Firefox or Chrome). For instance, in Firefox go to Web developer / Network. In Chrome, go to Developer tools / Network.
      5. Clean the console that you can see the calls to the services in the Network tab.
      6. Change the option in the Privacy settings.
      7. EXPECTED RESULT: You have to see an ajax request core_user_update_user_preferences in the Network tab.
      8. Select the same option in the Privacy settings.
      9. EXPECTED RESULT: Check that you don't see a new ajax request in the Network tab.
      10. Repeat again the same action and check you have the same result, not new ajax request.
      11. Change the option in the Privacy settings.
      12. EXPECTED RESULT: You have to see a new ajax request core_user_update_user_preferences in the Network tab.
      13. Close the privacy settings.
      14. Reload the site in the browser.
      15. Go to Messages Privacy preferences.
      16. EXPECTED RESULT: Check you can see the option checked that you have checked previously.
      Show
      Setup Test in 3.6 and master. Site-wide messaging enabled ('messagingallusers' is the setting name). Use a browser with Web developer tools like Firefox (Web developer) or Chrome (Developer Tools). Tests Log in as an admin Go to Messages Privacy preferences. Check you can see three options in Privacy settings: My contacts only My contacts and anyone in my courses Anyone on the site Open a Web developer tools in your browser (Firefox or Chrome). For instance, in Firefox go to Web developer / Network. In Chrome, go to Developer tools / Network. Clean the console that you can see the calls to the services in the Network tab. Change the option in the Privacy settings. EXPECTED RESULT: You have to see an ajax request core_user_update_user_preferences in the Network tab. Select the same option in the Privacy settings. EXPECTED RESULT: Check that you don't see a new ajax request in the Network tab. Repeat again the same action and check you have the same result, not new ajax request . Change the option in the Privacy settings. EXPECTED RESULT: You have to see a new ajax request core_user_update_user_preferences in the Network tab. Close the privacy settings. Reload the site in the browser. Go to Messages Privacy preferences. EXPECTED RESULT: Check you can see the option checked that you have checked previously.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull 3.6 Branch:
    • Pull Master Branch:
      MDL-64342-master

      Description

      Currently, on my messaging privacy preferences I can click the same item many times and it'll fire a request for each click. The same applies if hitting the enter key, allowing me to spam the backend. 

      We should investigate and see whether we can restrict this so it's only fired when the value is changed.

      I'm marking this one as a bug as we should try to address this one in 3.6 if the change isn't huge.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 12 minutes
                1h 12m