Remove all cached data when changing the API key in module settings

Created on 11 March 2024, over 1 year ago
Updated 27 August 2024, 10 months ago

Problem/Motivation

Pixabay search results are still cached, after changing the API key in module settings.

Steps to reproduce

  • Install and configure the module as stated in the readme file
  • Perform a search in the widget with a valid search key
  • Change the API key in module settings
  • Perform the same search with the same search key in the widget -> results will be shown
  • Perform a search with a different valid search key (that you haven't done before) -> Only now the API key validation error is shown

Proposed resolution

Remove the search term from the cache tag, when cache data is set and invalidate the cache based on this new tag, when the API key is changed in module settings.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇸🇮Slovenia slogar32

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @slogar32
  • First commit to issue fork.
  • 🇸🇮Slovenia agile-mark-l

    I have implemented the proposed resolution.

  • Status changed to Needs review 10 months ago
  • First commit to issue fork.
  • 🇸🇮Slovenia deaom

    Could reproduce the issue, first added a valid API key and searched for an image, updated the API key to an invalid one, searched with the same key, and got results. Changed the search key to something new and got the invalid API key error.

    Checked out the branch, first got an error for the $typeConfigManager not being correct type, updated that, repeated the steps with a new search key and valid API key, got results, updated the API key to an invalid one, searched with the same search key and immediately got the invalid API key error.

    Confirming the issue is resolved and marking as RTBC.

Production build 0.71.5 2024