Skip to content

Survey triggers are sent again on reload when two trigger requests overlap #14258

Todo

Description

@ncoetzer

Bug Description

When the dashboard sends two or more survey trigger requests at the same time, only some of the "already sent" records are saved. A trigger with no saved record is sent again on the next page load. Each trigger should be sent once for a user, and its record should be saved every time.

The server keeps all survey timeouts for a user in one list. Each trigger request reads the list, adds its own entry, and saves the whole list. When two requests overlap, the request that finishes last saves a list without the other request's entry (Survey_Timeouts::add(), called from REST_User_Surveys_Controller at line 129).

The bug needs two triggers to be sent at the same time. It does not happen every time, because it depends on timing. A trigger that was sent again is saved on a later reload, so the repeats stop. With three or more overlapping triggers, it can take more than two reloads.

This was found while testing #14144. On the main dashboard, view_dashboard and fdh_not_opened overlap. QA saw fdh_not_opened sent on every reload. The fdh_opened_no_interaction and view_pdf_export_downloaded triggers from #14145 overlap in the same way.

A repeated trigger is harmless today. The survey service shows a survey only once, however many times it is triggered.

Steps to reproduce

  1. Connect Site Kit with Google, and enable the featureDiscoveryHub feature flag.
  2. Use a user who has never opened the Add features screen.
  3. Open the browser DevTools Network tab, filter by survey-trigger, and turn on Preserve log.
  4. Open the main Site Kit dashboard. Two requests are sent: view_dashboard and fdh_not_opened.
  5. Reload the dashboard. One of the two requests is sent again, although it was already sent in step 4.
  6. Reload the dashboard a third time. No request is sent.

If both requests are sent again in step 5, or none is, repeat from step 4 with a user whose survey timeouts are empty. The result depends on timing.

Screenshots

Screen.Recording.2026-11-24.at.15.26.59.mov

Additional Context

  • PHP Version:
  • OS: [e.g. iOS]
  • Browser: [e.g. chrome, safari]
  • Plugin Version: [e.g. 22]
  • Device: [e.g. iPhone6]

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

Acceptance criteria

  • When two or more survey trigger requests with a ttl greater than 0 are sent at the same time for the same user, every one of their trigger IDs is saved in that user's survey timeouts. A GET to google-site-kit/v1/core/user/data/survey-timeouts lists all of them, whatever order the requests finish in.
  • On the main dashboard, for a user who has never opened the Add features screen, has at least one unread feature, and has at least two features not set up, with the featureDiscoveryHub feature flag enabled:
    • The first load sends survey-trigger requests for view_dashboard and fdh_not_opened, together with any other trigger the dashboard sends on that load (for example view_pdf_export_not_used, view_kmw, and view_ads_setup_cta).
    • After that load, the survey timeouts list every trigger that was sent, including view_dashboard and fdh_not_opened.
    • The next reload sends no survey-trigger request for any trigger that the first load sent.
  • The same holds for three overlapping triggers. For example, after fdh_not_opened, fdh_opened_no_interaction, and fdh_opened_with_interaction are sent at the same time, the survey timeouts list all three. No trigger is sent again on the next reload.
  • When a survey-event request with a survey_shown event overlaps with a survey-trigger request, the 12-hour global timeout (__global) and the trigger's timeout are both saved.
  • The following behavior stays unchanged:
    • A trigger sent with ttl set to 0, or without a ttl, saves no timeout and can be sent again on the next load.
    • A trigger request that the survey service answers with an error saves no timeout.
    • Timeouts that were saved before the overlapping requests and have not expired stay in the list. Expired timeouts are not returned.
    • A trigger that is already in the survey timeouts is not sent again.
    • One user's survey timeouts do not change when another user's triggers are sent.

Implementation Brief

Test Coverage

QA Brief

Changelog entry

Activity

  1. added
    Type: Bug
    P1
    Team M
    on Nov 24, 2026
  2. self-assigned this
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1Team MType: Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions