The functionality of showing results behaves abnormally on tab switch sometimes

Created on 5 September 2024, 5 months ago

Problem/Motivation

If we choose a filter (say, the "Access Control" category), it works and we get results. Recipes tab still shows 28 results. Then when we click over to the Recipes and it shows 0 results after a flash. If we go back to the Drupal.org tab and clear the filter, then back to recipes, it works and shows all the recipes.

On subsequent loads it behaves a little better; it seems to be the first time you choose a filter.

Steps to reproduce

  1. Go to on Drupal.org tab.
  2. Choose a filter (say, the "Access Control" category)
  3. Go to Recipes tab

Proposed resolution

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia kunal.sachdev

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

Merge Requests

Comments & Activities

  • Issue created by @kunal.sachdev
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia guptahemant

    I am able to consistently reproduce this issue, and it seems filters are conflicting between different tabs, Like if i select Accessibility on Drupal.org tab and then i switch to recipes do couple of refreshes i am able to see recipes but then if i try to search for recipe named performance, i am not able to see the results and i see zero results.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia guptahemant

    Updated the title and summary to better reflect the issue.

  • First commit to issue fork.
  • First commit to issue fork.
  • Merge request !590Improve tab-switching and data fetching โ†’ (Merged) created by andy-blum
  • Pipeline finished with Failed
    4 months ago
    Total: 546s
    #294802
  • First commit to issue fork.
  • Pipeline finished with Failed
    3 months ago
    Total: 351s
    #310148
  • Pipeline finished with Failed
    3 months ago
    Total: 752s
    #310209
  • Pipeline finished with Success
    3 months ago
    #310235
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    Have done some manual testing and I can confirm this fixes a ton of the flashing and jumping back and forth and is a significant improvement.

    One thing I'm noticing, and I'm wondering if it's introduced by this MR or not, is that the categories seem to disappear for me from time-to-time (not every time) as I shift tabs back and forth. Note that I did also enable the Drupal core plugin, in case that has something to do with it.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    Re #10, It seems an existing issue to me.
    Steps to reproduce:

    • Enable Drupal core plugin
    • On Drupal.org(JSON:API), click clear filters
    • Select first 3 categories from category dropdown
    • Switch tab to Drupal core plugin and select one category, eg: Core(Experimental)
    • Switch tabs in random order to see the issue
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    OK, then we should open a separate issue for that, while this is an improvement. Has all MR review been addressed?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    ๐Ÿ› Selected categories disappear on switching tabs Active has been created. The ProjectBrowserUiTest::testMultiplePlugins should be updated to ensure this issue is caught in the first place. I will make the necessary updates and report back.

  • Pipeline finished with Failed
    3 months ago
    Total: 448s
    #311838
  • Pipeline finished with Success
    3 months ago
    Total: 437s
    #311855
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India
  • Pipeline finished with Canceled
    3 months ago
    Total: 352s
    #312801
  • Pipeline finished with Success
    3 months ago
    Total: 365s
    #312808
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    Suggestion applied and comment added.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    @narendrar kindly got on Zoom with me to explain the nature of the problem and what he did. Thanks to his clear explanation, I see what was going on -- the filters applied on any given tab were being applied globally (that is, to all tabs), which of course would filter out all results on other tabs. The tests weren't catching this because they were asserting the wrong thing.

    Naren demonstrated that the adjusted test fails on 2.0.x HEAD, so all good there!

    The changes in the code now make sense to me; we're keeping all filters localized to particular tabs, except for the keyword search, which is globally applied. The tests appear to cover that this works.

    A little manual testing couldn't hurt but I'm too busy with other things for that, and I'm satisfied that this does what's advertised and fixes the bug. Therefore, RTBC!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    I'm not 100% that there should be a special case of what "carries over" - maybe nothing should. however, I think we should advance this issue, and if UX people bring it up later, we'll file it then (I don't even think we should file a FU now, even). I will test and review.

  • Pipeline finished with Failed
    3 months ago
    Total: 322s
    #313401
  • Pipeline finished with Success
    3 months ago
    Total: 328s
    #313407
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    thanks @narendraR, i've just tested your latest changes and i can confirm as soon as the last checkbox in a multiselect is unchecked the results count is set back to the number of all available modules for the the source type in question.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tim.plunkett Philadelphia

    This has a legit merge conflict after ๐Ÿ› Selected categories disappear on switching tabs Active went in, not just on the compiled svelte.

  • Pipeline finished with Failed
    3 months ago
    Total: 1082s
    #319774
  • Pipeline finished with Success
    3 months ago
    Total: 449s
    #320113
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    Rebased to latest code.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Kapow!

  • Pipeline finished with Failed
    3 months ago
    Total: 1258s
    #324462
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    Are these test failures legit? Bad rebase from last commit?

    It's curious that the same test failed twice, but with a different number (3 vs. 2)?!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India
  • Pipeline finished with Skipped
    3 months ago
    #325217
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    Wonderful! This was a tricky one - thanks for the refactor.

  • Status changed to Fixed 2 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024