question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cached user surveys have incorrect TTL

See original GitHub issue

Bug Description

The current implementation of the triggerSurvey action does not set TTL when it caches the survey: https://github.com/google/site-kit-wp/blob/eea7808d8ab973561179d2d15d9fa327485aeb15/assets/js/googlesitekit/datastore/user/surveys.js#L109-L112

It means that all surveys are cached for an hour since it is the default value for the setItem function.


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

Acceptance criteria

  • The triggerSurvey action should pass the provided ttl to the setItem function call to cache surveys for intended period of time.

Implementation Brief

  • Add js tests to verify that the survey is cached for specified ttl.
  • Merge #3656

Test Coverage

  • N/A

Visual Regression Changes

  • N/A

QA Brief

  • Check the triggerSurvey action and verify that it correctly passes the ttl parameter to the setItem function call.

Changelog entry

  • Add a configurable timeout to User Survey components.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
eugene-manuilovcommented, Jul 1, 2021

@aaemnnosttv, yes we can add tests. IB is updated.

0reactions
aaemnnosttvcommented, Jul 9, 2021

@Hazlitte you don’t need to select icon and close the survey. Just open the dashboard page and when the user survey appears, check the session storage, it should contain a record for that survey with the appropriate ttl (1 hour).

@eugene-manuilov this was already the case before but essentially relying on the default ttl rather than the one which was provided that was incorrect. The added test coverage should cover the scenario though 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop using ridiculously low DNS TTLs - APNIC Blog
If you use a local DNS cache such as dnscrypt-proxy that allows minimum TTLs to be set, use that feature. This is okay....
Read more >
Hit-for-Miss AND why a NULL TTL is bad for you - Resources
A null TTL sounds like a good idea in theory... but also very wrong. In this post, we'll explore why it's a bad...
Read more >
Route53 propagation time with ISPs not respecting TTL
I would like to have a possibility of redirecting traffic to other regions modifying Route53 rules and to be sure DNS failover policy...
Read more >
What should I set the TTL for my DNS to?
As you already state in your question: a high TTL conflicts with a possible insecure mail server and a low TTL conflicts with...
Read more >
Adaptive TTL-Based Caching for Content Delivery
(TTL)-based caching algorithms [8]–[13] use a TTL parameter to determine how long an object may remain in cache. TTL caches have emerged as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found