Page MenuHomePhabricator

"Exclude selected" in "Namespaces" doesn't work when using "Saved filters" in RecentChanges
Closed, ResolvedPublic

Description

When I select a saved filter with excluded namespaces in RecentChanges, those namespaces are not excluded: "Exclude selected" in the "Namespaces" menu is not marked, even though it was marked when the filter was saved.

This has the effect that all other namespaces instead are excluded. This occurs in my English, Swedish and Test2 Wikipedia accounts, so appears to be global.

This does not occur in my Swedish Wikipedia account when the RecentChanges page is initially loaded with my default filter which was saved some time ago and has excluded namespaces, but it does occur in my English account when the page is initially loaded with a default filter that was saved after I first noticed this error. Changing the English default filter to a filter that was saved some time ago does not make the namespace exclusion work on initial page load.

Event Timeline

I was able to reproduce this bug on en.wiki. @Pipetricker is right: if you set up a filter using the Namespace>Exclude function, it works fine. But then if you bookmark that as a Saved Filter, the Exclude part doesn't get saved, and you end up searching for the thing you wanted to exclude.

The issue is present in betalabs too.

Change 401572 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] RCFilters: Correct looking for items in namespace group

https://gerrit.wikimedia.org/r/401572

Fixed a typo that caused this. It should work now, but I can't retroactively fix the incorrectly saved queries -- after the patch is merged and deployed, please re-save the saved filters that had 'excluded' in them again.

Change 401576 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@wmf/1.31.0-wmf.15] RCFilters: Correct looking for items in namespace group

https://gerrit.wikimedia.org/r/401576

Change 401578 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@wmf/1.31.0-wmf.12] RCFilters: Correct looking for items in namespace group

https://gerrit.wikimedia.org/r/401578

Change 401572 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Correct looking for items in namespace group

https://gerrit.wikimedia.org/r/401572

Fixed a typo that caused this. It should work now, but I can't retroactively fix the incorrectly saved queries -- after the patch is merged and deployed, please re-save the saved filters that had 'excluded' in them again.

When was this typo deployed? (and can I find that information myself?)

Change 401607 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

https://gerrit.wikimedia.org/r/401607

Change 401607 merged by jenkins-bot:
[mediawiki/core@master] Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

https://gerrit.wikimedia.org/r/401607

Checked in betalabs - https://gerrit.wikimedia.org/r/#/c/401572/ works.

Checked enwiki (wmf.12) and mediawiki and testwiki (wmf.15).

Change 401614 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@wmf/1.31.0-wmf.12] Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

https://gerrit.wikimedia.org/r/401614

Change 401615 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@wmf/1.31.0-wmf.15] Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

https://gerrit.wikimedia.org/r/401615

When was this typo deployed? (and can I find that information myself?)

It seemed to have originated from this commit: https://gerrit.wikimedia.org/r/#/c/392182/ This commit was merged into the wmf12 (current deployment in production) and wmf15 (current train)
The fix in this ticket will be SWAT'ed into deployment (both wmf12 and wmf15) today at 4pm PST, so it will start working correctly after that.

WMF12 was pushed to the wikis before the holiday (the week of December 12th), but the way that saved queries work, I would recommend re-saving any query that has "excluded" in it just in case. I know it's annoying, but I would do that just to be safe -- after today's SWAT at 5pm PST.

As for how to find this information - unfortunately, it's not straight forward. I used "git blame" on the branch before the current submitted patch to see what added the lines of code that I just fixed, and found the gerrit commit above, but you can really only do that if you have the git repository and know more or less where to look.
We can probably find it for you if you need it in the future, but sometimes finding these things can be a little convoluted -- In this case, it was fairly straight forward, but the changes to the code can be codependent, so there might be a bigger chain of fixes to search through.

Thanks @Mooeypoo.
After the SWAT, I will retry my older saved filters which have exclusions. As I said in the bug description, my default Swedish filter still works correctly on page load (but not when subsequently selected).

Thanks @Mooeypoo.
After the SWAT, I will retry my older saved filters which have exclusions. As I said in the bug description, my default Swedish filter still works correctly on page load (but not when subsequently selected).

I have to say, I'm fairly sure that old saved filters won't remember the "excluded" because the bug resulted in "cleaning it up" (meh) but any newly saved filters with 'excluded' button should be saved properly. We've been also testing this on Beta (where the fix is already available) and it works properly, so after SWAT today, new saved filters should work.
Sadly, I am fairly sure you'll have to re-save any old filters that had 'excluded' in them, because there's no way for the system to recover that information.

I would be super happy to know if I'm wrong though, and I have a feeling I might, since you're saying that the Default filter loads fine -- if you can, please first try your current/old saved filters after today's SWAT and let me know if they work.

If they do, great! If not, you might have to re-save only the ones that have 'excluded' in them.

@Pipetricker actually, I hve an idea of why your setup works with your Default but not on reload. I think you haven't saved any new saved filters in the past 2 weeks or so -- if that's the case, then the fix we are doing today in SWAT will seamlessly fix your setup, and you need to do nothing :)

If, however, you saved any saved filters (added another filter or deleted a saved filter, etc) then the (pre-fix) system will permanently delete the excluded definition... so I think your setup will actually work perfectly after today's SWAT.

Can you let me know, just in case? If there are any subsequent bugs, I want to be on top of it.

Thanks for spotting this!

Yes, in my Swedish account, I haven't made any change to my saved filters in more than a month (other than selecting active filters). I'll get back to you after the SWAT.

Change 401576 merged by jenkins-bot:
[mediawiki/core@wmf/1.31.0-wmf.15] RCFilters: Correct looking for items in namespace group

https://gerrit.wikimedia.org/r/401576

Change 401578 merged by jenkins-bot:
[mediawiki/core@wmf/1.31.0-wmf.12] RCFilters: Correct looking for items in namespace group

https://gerrit.wikimedia.org/r/401578

Change 401614 merged by jenkins-bot:
[mediawiki/core@wmf/1.31.0-wmf.12] Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

https://gerrit.wikimedia.org/r/401614

Change 401615 merged by jenkins-bot:
[mediawiki/core@wmf/1.31.0-wmf.15] Follow-up Ic67a6f1af: RCFilters: Untypo the recurring namespaces typo

https://gerrit.wikimedia.org/r/401615

in my Swedish account, I haven't made any change to my saved filters in more than a month (other than selecting active filters). I'll get back to you after the SWAT.

@Mooeypoo, as expected all my English saved filters with exclusions will need to be re-saved, while all of my Swedish old saved filters now work as they should again.

in my Swedish account, I haven't made any change to my saved filters in more than a month (other than selecting active filters). I'll get back to you after the SWAT.

@Mooeypoo, as expected all my English saved filters with exclusions will need to be re-saved, while all of my Swedish saved filters now works as they should again.

Okay, I'm glad to hear that it works now, and I apologize for you having to re-save some of your filters.
Please let us know if you encounter any more bugs with this, and thanks for raising this one to our attention!

@Johan, something for Problems in the next Tech News?

Affected users: Those who have any "Saved filters" with excluded namespaces, and have saved or removed (or renamed?) any saved filters, from the week of 12 December until tonight. (Is that right, Mooeypoo?)

@Johan, something for Problems in the next Tech News?

Affected users: Those who have any "Saved filters" with excluded namespaces, and have saved or removed (or renamed?) any saved filters, from the week of 12 December until tonight. (Is that right, Mooeypoo?)

That sounds right, yes; any change to the "saved filters" during the time from Dec 12 to today would affect the filters that have used "Excluded" (invert parameter)

This has been added to Tech/News/2018/02, with some simplification. Feel free to edit if there are any mistakes in the item; it will be sent to the translators in ~24 hours.

With a thought to the Tech News notice:

any change to the "saved filters" during the time from Dec 12 to today would affect the filters that have used "Excluded"

I understand this to include renaming. To be nitpicky: Would "Set as default" affect this?

I understand this to include renaming. To be nitpicky: Would "Set as default" affect this?

Unfortunately yes. Any change that would require the system to re-save the saved filters in the database would have meant the 'excluded' was affected. That would be set as default, deleting a filter, adding a filter and renaming a filter.

Thank you. Then I think the upcoming Tech News is worded correctly about this.

I may misunderstand but this seems wrong to me: "When you loaded the saved filter all other namespaces were excluded instead."

What actually happened is not that other namespaces were excluded, but rather that "excluded" was ignored.
If no changes were made to the filter set the problem was self-corrected, but if any change was made, these specific filters that had "excluded" in them may need to be re-saved.

Does that make sense or did I misread?

The issue has been updated.

When any namespaces are selected, but "Exclude selected" is not selected, only the selected namespaces are shown, so other namespaces are effectually excluded. This is how it worked and still works with my filters (which I have kept) which were affected by the bug, and how it works with any filter.

When any namespaces are selected, but "Exclude selected" is not selected, only the selected namespaces are shown, so other namespaces are effectually excluded. This is how it worked and still works with my filters (which I have kept) which were affected by the bug, and how it works with any filter.

Oohf, yes, you're right, but I think it's super confusing like that. I think saying that the 'excluded' was ignored may be clearer, but I am open to whatever makes sense to everyone.
I think this is a case where my thinking is from "code" perspective (the feature was ignored) and yours is user perspective (the actual result) -- so yours may make more sense, but I actually can't judge either way :)

Well, selecting a namespace has an automatic "Exclude unselected" effect when "Exclude selected" is not selected.

So I think the sentence Johan removed is a good wording for explaining the effect clearly and succinctly.