Skip to content

Prevent RRM settings request if it is inactive #11346

@nfmohit

Description

@nfmohit

Bug Description

The Site Kit dashboard makes a fetch request to get the Reader Revenue Manager settings even if the module is not active, which should be avoided.

(Props to @aaemnnosttv for reporting)

Steps to reproduce

  1. Go to the Site Kit dashboard with the Reader Revenue Manager module not active.
  2. Monitor the network requests.
  3. Notice that a GET request to /wp-json/google-site-kit/v1/modules/reader-revenue-manager/data/settings is made.

Screenshots

Image

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance Criteria

  • When the RRM module is inactive, requests to the RRM settings endpoint should not be triggered from the dashboard or any Site Kit screen.

Implementation Brief

  • In assets/js/modules/reader-revenue-manager/index.js, update the checkRequirements callback for the following notifications to check if RRM module is active (isModuleActive method), if not active, return false.
    • ProductIDSubscriptionsNotification
    • ProductIDContributionsNotification

Test coverage

  • Add the test for this change to ensure settings endpoint is not triggered when RRM module is not active.

QA Brief

  • Follow the "Steps to reproduce" above
  • Verify that no request to get the RRM settings was made

Changelog entry

  • Prevent requests to the Reader Revenue Manager settings endpoint from being triggered when the Reader Revenue Manager module is inactive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityTeam MIssues for Squad 2Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions