Skip to content

[API merging] Listing publications fails in RRM express setup #13622

Closed

Description

@nfmohit

Bug Description

The request to list publications in RRM express setup fails with a 500 error, or returns an empty list. This happens due to two reasons:

  1. The ListPublications method in the webcontentpublisher API does not currently support a wildcard for organization, which was planned at the initial stage. The RRM team is looking into this problem separately. This causes the 500 error.
  2. The filter argument to use with the method has a different shape. The susbcribewithgoogle API accepts domain or site_url, but webcontentpublisher accepts multiple canonical_domain entries separated by OR. For the passed value, the API performs an exact string match against the stored database value. If passed incorrectly, this causes the method to return the empty or incorrect list.

Steps to reproduce

  1. Ensure Request the new RRM scopes for the express setup #13004 is merged.
  2. Ensure the RRM team has fixed the wildcard support issue mentioned above (reason 1).
  3. Turn on the rrmExpressSetup feature flag.
  4. Set up Site Kit.
  5. Go to the RRM express setup in yoursite.com/wp-admin/admin.php?page=googlesitekit-dashboard&slug=reader-revenue-manager&reAuth=true&expressSetup=true&cta=newsletter-signup&step=connect-publication.
  6. Notice that you cannot see your existing publications and are asked to create a new one.

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

Acceptance criteria

  • Listing existing publications in the Reader Revenue Manager express setup flow no longer fails due to the reasons mentioned in the issue description.

Implementation Brief

  • In Get_Publications::get_publication_filter(), replace the domain and site_url comparisons with a set of canonical_domain comparisons joined by OR. The webcontentpublisher API matches this value as an exact string, so the filter has to enumerate every form the site could have been stored under.
  • Derive both a hostname and a site URL from the Search Console property, whichever type it is. For a domain property, the host is the property with the sc-domain: prefix removed and the URL is that host under https. For a URL property, the host comes from parsing the property with URL::parse() and the URL is the property itself.
  • Build the candidate list from three sources and deduplicate it: URL::permute_site_hosts() for bare hostnames, URL::permute_site_url() for full URLs, and those same URLs with any trailing slash removed. The bare hostnames and the trailing slash variants both matter because a publication created in Publisher Center and one created through Site Kit may not store the canonical domain in the same form.
  • Get_Publications_Legacy is unchanged. It talks to the older subscribewithgoogle API, which still accepts domain and site_url.
  • No Site Kit change addresses the 500 error. The wildcard organization in the ListPublications parent is being fixed on the API side by the RRM team.

Test Coverage

  • Update test_create_request, test_get_publications__url and test_get_publications__domain in Get_PublicationsTest, which currently assert the site_url = "..." and domain = "..." shapes.
  • Cover a URL property carrying a trailing slash, such as https://example.com/, asserting the filter contains the bare hosts, the slashed URLs and the unslashed URLs, each in www and non-www form over both schemes.
  • Cover a domain property, asserting the same set is produced from sc-domain:example.com.
  • Cover an IDN property, asserting both the punycode and unicode hostnames appear.
  • Assert the filter contains no duplicate terms for a property whose host is already www., where the host and URL permutations overlap.

QA Brief

  1. Turn on the rrmExpressSetup feature flag.
  2. Set up Site Kit using a Google account that has publications created with the URL of your test site.
  3. In the traffic section, click on the "Set up a sign-up form" CTA in the "Collect reader emails directly on your site" notification.
  4. Verify that you can see your existing publications and that you don't run into an error.

Changelog entry

  • Fix listing existing publications in the Reader Revenue Manager express setup flow.

Activity

  1. self-assigned this
    on Sep 18, 2026
  2. added
    Type: BugSomething isn't working
    P0High priority
    Team MIssues for Squad 2
    Module: RRMReader Revenue Manager module related issues
    on Sep 18, 2026
  3. added 2 commits that reference this issue on Sep 24, 2026
  4. removed their assignment
    on Sep 27, 2026
  5. self-assigned this
    on Sep 28, 2026
  6. added a commit that references this issue on Sep 28, 2026
  7. removed their assignment
    on Sep 28, 2026
  8. self-assigned this
    on Sep 29, 2026
  9. mohitwp commented on Sep 29, 2026

    @mohitwp
    Collaborator

    QA Update ✅

    • Tested on main environment.

    • Tested the RRM Express Setup publication listing flow with the rrmExpressSetup feature flag enabled.

    • Verified that existing RRM publications are successfully listed during the "Connect publication" step without encountering the previous 500 error or empty publication list issue.

    Validated the following scenarios:

    • Existing publication available for the site:

      • Confirmed the existing publication is displayed in the publication dropdown.
      • Successfully connected the existing publication and continued the setup flow.
    • No existing publication available:

      • Verified that the flow allows creating a new publication when no existing publication is available.
      • Confirmed the new publication creation flow works as expected.

    No issues observed during testing.

    Details
    Recording.3464.mp4
  10. removed their assignment
    on Sep 29, 2026
  11. mohitwp commented on Sep 30, 2026

    @mohitwp
    Collaborator

    QA Update ✅

    • Tested on main environment,
    • Tested with 'rrmExpressSetup' feature flag enabled and MockAPI disabled.
    • Verified that existing RRM publications are successfully listed during the "Connect publication" step without encountering the previous 500 error or empty publication list issue.

    Verified

    • Existing publication available for the site:

      • Confirmed the existing publication is displayed in the publication dropdown.
    • No existing publication available:

      • Verified that the flow allows creating a new publication when no existing publication is available.

    Note : Can't test create publication flow and Setup CTA flow due to API error.

    Details Image Image Image
    Recording.3469.mp4
  12. removed their assignment
    on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module: RRMReader Revenue Manager module related issuesP0High 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

      Sponsor
      SponsoredKunjungi sekarang
      Promo