A filter applying a tag and another one having a condition on it

I have a filter that adds a “skipnotify” tag on some of the articles in one of my feeds. I have another filter that sends a notofication using pushover plugin, except when a “skipnotify” tag is found. Fairly basic stuff, except it doesn’t work during the first pass, i.e. when new article arrives, and only after second pass and onwards.

Filters are in the expected order of processing, and from the looks of it, the tag that is applied to the new article is not actually persisted and therefore not seen by any other filter in the chain until after all of the processing has completed. Is that by design or is this a bug? And if that’s by design, is there any other way I can achieve the same result?

PS. I tried searching for a similar problem in the forums, as this appears to me that the above is a rather common use case, but I suppose the keywords I had to use to search are too generic and the search results are all over the place.

you won’t be able to write filters depending on results of other filters.

i think this should explain how it works Filter on labels? - #2 by fox - Tiny Tiny RSS - Tiny Tiny RSS: Community

e: i’ve added this to the wiki - ContentFilters - tt-rss - Tiny Tiny RSS

Thanks. That helps. And a good call on adding it to the wiki as well!

There’s one more thing that may need some clarification. The manual says that the Stop / Do nothing action:

stops further filter processing for this article, no following filters will be checked nor rules applied.

This logically contradicts what the FAQ you added says:

I’m trying to make a filter which works conditionally based on an action of a previous filter, and it doesn’t work. What gives?

It’s a design limitation. All actions for an article are applied together, once

And does Stop / Do nothing action even work at all as explained? Cause on my end it doesn’t seem to, i.e. all matching filters are applied even if a matching filter placed higher on the list has a Stop / Do nothing' action, which seems to corroborate what the added FAQ entry says.

you won’t be able to write filters depending on results of other filters.

a filter which works conditionally based on an action of a previous filter

You can’t (for example) set a score and expect a different filter to see the new score. The original value is given to all of the filters unchanged, and filtering runs in a single pass.

Stop (or “Save&Exit”) isn’t a way to react to a new value. It simply stops all further filters. (Consider a noisy feed; you may have a filter that tags/scores a few good articles, then Stops. The next filter archives 100% of the articles. The end result is that a few good articles remain, as they only run the first filter, and there are zero rules to maintain in the second.

i don’t personally use this feature so it could well be broken. i’ll make a note to run some debugging but i’m not sure when i’ll find the time.

Well, in that case, I am quite sure it’s broken, as it does not stop ttrss from further processing filters.

i was unable to replicate this. i made two filters:

then i ran the debugger:

[16:33:04/17006] loading filters & labels...
Array
(
    [0] => Array
        (
            [id] => 1351
            [match_any_rule] => 
            [inverse] => 
            [rules] => Array
                (
                    [0] => Array
                        (
                            [reg_exp] => .
                            [type] => title
                            [inverse] => 
                        )

                )

            [actions] => Array
                (
                    [0] => Array
                        (
                            [type] => stop
                            [param] => 
                        )

                )

        )

    [1] => Array
        (
            [id] => 1352
            [match_any_rule] => 
            [inverse] => 
            [rules] => Array
                (
                    [0] => Array
                        (
                            [reg_exp] => .
                            [type] => title
                            [inverse] => 
                        )

                )

            [actions] => Array
                (
                    [0] => Array
                        (
                            [type] => label
                            [param] => AAйA Test1211
                        )

                )

        )

)
[16:33:04/17006] 2 filters loaded.
[16:33:04/17006] processing articles...
[16:33:04/17006] =================================================================================================================================
[16:33:04/17006] guid 2,tag:srv.tt-rss.org,2022-09-11:/FairEmail-fdroid-release.apk,1965 (hash: {"ver":2,"uid":2,"hash":"SHA1:2116342b990f8e3002ccb84e753730baf4c0f7a8"} compat: SHA1:52d2aa7e9311e6bd35587fe87ca973b67792fcca)
[16:33:04/17006] orig date: 1662869221 (2022-09-11 04:07:01)
[16:33:04/17006] title FairEmail-fork (1965)
[16:33:04/17006] link https://srv.tt-rss.org/fdroid/repo/FairEmail-fdroid-release.apk?1662869221669
[16:33:04/17006] language 
[16:33:04/17006] author build bot
[16:33:04/17006] looking for tags...
[16:33:04/17006] tags found: 
[16:33:04/17006] done collecting data.
[16:33:04/17006] looking for enclosures...
[16:33:04/17006] article hash: 08f7f54ab23db1e8f51cec108239523b4d00a153 [stored=08f7f54ab23db1e8f51cec108239523b4d00a153]
[16:33:04/17006] hash differs, running HOOK_ARTICLE_FILTER handlers...
[16:33:04/17006] === 0.0001 (sec) Af_Comics
[16:33:04/17006] === 0.0001 (sec) Af_Fontanka
[16:33:04/17006] === 0.0009 (sec) Af_GoodShowSir
[16:33:04/17006] === 0.0026 (sec) Af_Psql_Trgm
[16:33:04/17006] === 0.0026 (sec) Af_Readability
[16:33:04/17006] === 0.0027 (sec) Af_RedditImgur
[16:33:04/17006] === 0.0057 (sec) Auto_Assign_Labels
[16:33:04/17006] === 0.0058 (sec) Af_Img_Phash
[16:33:04/17006] === 0.0064 (sec) Api_Resize_Media
[16:33:04/17006] plugin data: af_comics,af_fontanka,af_goodshowsir,af_psql_trgm,af_readability,af_redditimgur,auto_assign_labels,af_img_phash,api_resize_media,
[16:33:04/17006] matched filters: 
Array
(
    [0] => Array
        (
            [id] => 1351
            [match_any_rule] => 
            [inverse] => 
            [rules] => Array
                (
                    [0] => Array
                        (
                            [reg_exp] => .
                            [type] => title
                            [inverse] => 
                        )

                )

            [actions] => Array
                (
                    [0] => Array
                        (
                            [type] => stop
                            [param] => 
                        )

                )

        )

)
[16:33:04/17006] matched filter rules: 
Array
(
    [0] => Array
        (
            [reg_exp] => .
            [type] => title
            [inverse] => 
        )

)
[16:33:04/17006] filter actions: 
Array
(
    [0] => Array
        (
            [type] => stop
            [param] => 
        )

)

as you can see, only one filter action is matched, the stop one. test label is not assigned.

if i disable the first filter, label is applied.

[16:35:21/17007] loading filters & labels...
Array
(
    [0] => Array
        (
            [id] => 1352
            [match_any_rule] => 
            [inverse] => 
            [rules] => Array
                (
                    [0] => Array
                        (
                            [reg_exp] => .
                            [type] => title
                            [inverse] => 
                        )

                )

            [actions] => Array
                (
                    [0] => Array
                        (
                            [type] => label
                            [param] => AAйA Test1211
                        )

                )

        )

)
[16:35:21/17007] 1 filters loaded.
[16:35:21/17007] processing articles...
[16:35:21/17007] =================================================================================================================================
[16:35:21/17007] guid 2,tag:srv.tt-rss.org,2022-09-11:/FairEmail-fdroid-release.apk,1965 (hash: {"ver":2,"uid":2,"hash":"SHA1:2116342b990f8e3002ccb84e753730baf4c0f7a8"} compat: SHA1:52d2aa7e9311e6bd35587fe87ca973b67792fcca)
[16:35:21/17007] orig date: 1662869221 (2022-09-11 04:07:01)
[16:35:21/17007] title FairEmail-fork (1965)
[16:35:21/17007] link https://srv.tt-rss.org/fdroid/repo/FairEmail-fdroid-release.apk?1662869221669
[16:35:21/17007] language 
[16:35:21/17007] author build bot
[16:35:21/17007] looking for tags...
[16:35:21/17007] tags found: 
[16:35:21/17007] done collecting data.
[16:35:21/17007] looking for enclosures...
[16:35:21/17007] article hash: 08f7f54ab23db1e8f51cec108239523b4d00a153 [stored=08f7f54ab23db1e8f51cec108239523b4d00a153]
[16:35:21/17007] hash differs, running HOOK_ARTICLE_FILTER handlers...
[16:35:21/17007] === 0.0000 (sec) Af_Comics
[16:35:21/17007] === 0.0000 (sec) Af_Fontanka
[16:35:21/17007] === 0.0002 (sec) Af_GoodShowSir
[16:35:21/17007] === 0.0007 (sec) Af_Psql_Trgm
[16:35:21/17007] === 0.0007 (sec) Af_Readability
[16:35:21/17007] === 0.0007 (sec) Af_RedditImgur
[16:35:21/17007] === 0.0019 (sec) Auto_Assign_Labels
[16:35:21/17007] === 0.0019 (sec) Af_Img_Phash
[16:35:21/17007] === 0.0020 (sec) Api_Resize_Media
[16:35:21/17007] plugin data: af_comics,af_fontanka,af_goodshowsir,af_psql_trgm,af_readability,af_redditimgur,auto_assign_labels,af_img_phash,api_resize_media,
[16:35:21/17007] matched filters: 
Array
(
    [0] => Array
        (
            [id] => 1352
            [match_any_rule] => 
            [inverse] => 
            [rules] => Array
                (
                    [0] => Array
                        (
                            [reg_exp] => .
                            [type] => title
                            [inverse] => 
                        )

                )

            [actions] => Array
                (
                    [0] => Array
                        (
                            [type] => label
                            [param] => AAйA Test1211
                        )

                )

        )

)

Thanks for testing this. I’ll post my debug log later tonight and tomorrow.