Queueing URLs that should not be queued

Created on 9 March 2021, over 3 years ago
Updated 1 November 2023, 11 months ago

Problem/Motivation

Currently, the module gets the tagid's from the purge_queuer_url_tag table, then saves those tagid's on the purge_queuer_url table by imploding them (using ';') and pretending it with another ';'. Then, when trying to find out if a URL should be invalidated or not based on a tagid, it queries for URLs with tags that are like "%;1%" (considering a tagid of 1).

The issue with this approach is that it will match any other tags that start with 1, examples: 10, 11, 12, 100, 1008 and so on, because they will all be saved as ;10 or ;11 and that matches the condition "%;1%".

Steps to reproduce

I will add a test to make sure this functionality works which hopefully should clarify a bit the behavior.

Proposed resolution

When saving the tagid's, also add a ';' at the end of the string, having something like the following:

for tagid 1: ";1;"
for tagids 1 and 2: ";1;2;"

Then, when querying for URLs, use like "%;1;%" instead.

Remaining tasks

- [DONE] Create a test case
- [DONE] Fix the issue
- [DONE] Create a post_update hook to make sure they all have the trailing ';'

User interface changes

NA

API changes

NA

Data model changes

NA

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇷Brazil dungahk Balneário Camboriú

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024