Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search not working on Master Branch #3833

Open
pikurasa opened this issue Mar 19, 2024 · 4 comments
Open

Search not working on Master Branch #3833

pikurasa opened this issue Mar 19, 2024 · 4 comments

Comments

@pikurasa
Copy link
Collaborator

Description

I noticed this a few weeks ago. The search on the master branch is no longer working.

It still works on the version on https://musicblocks.sugarlabs.org/

Expected Behavior

Search should work.

Screenshots

Various tests on the master branch and https://sugarlabs.github.io/musicblocks/
Screenshot from 2024-03-19 15-07-21
Screenshot from 2024-03-19 15-01-01
Screenshot from 2024-03-19 15-10-21

How to Reproduce

  1. Checkout master branch (currently 7f231ce01 fix(background): bacground of loader (#3832)) or go to https://sugarlabs.github.io/musicblocks/
  2. Type something into search
  3. Possible choices will not display

Console log Errors:

I do not see anything in the logs.

Environment:

Tested on Chromium on a Debian distro.

@Ashish020202
Copy link
Contributor

Hello @walterbender @pikurasa I think this behaviour after #3782 pls check once.
As its a depreciation fix and long changes not able to find what actual problem is .

@walterbender
Copy link
Member

Just did some testing. Seems it is both due to changing the jquery version and adding the "try/except" glue around doSearch. Reverting both the jquery version and removing the glue fixes the problem. But not yet sure what the root cause is.

@Ashish020202
Copy link
Contributor

yes the acutual problem arises from there but as this is big changes unable to figure out where should be actual problem

@harshuttamchandani
Copy link
Contributor

So I found a few interesting things that might help with this issue.
I am also able to replicate this issue on https://musicblocks.sugarlabs.org/ once in a while.
To me, it seems like some kind of race condition.
This issue exists even before the commit ce127c7
Looks like the following script block is redundant in functionality. There is no global doSearch() function. However, the presence of this block is helping in order of execution of the scripts in some non-deterministic way.

<script type="text/javascript">
            $(document).ready(function() {
                doSearch();
            });
        </script>

in index.html even if we change the doSearch() function to a random function name the search functionality works correctly.

<script type="text/javascript">
            $(document).ready(function() {
                abcd();
            });
  </script>

However, if I remove this block I do face the issue where the search functionality doesn't work.
Upgrading jQuery has exacerbated the race condition though doesn't seem to be the actual cause of the problem.

Attaching the screenshot of this issue on musicblocks.sugarlabs.org
musicblock site
console log

harshuttamchandani added a commit to harshuttamchandani/musicblocks that referenced this issue Apr 2, 2024
As discussed in sugarlabs#3833 the doSearch function doesn't seem necessary and is not contributing
sugarlabs#3833 (comment)

Removing this doesn't change the functionality of the code.
walterbender pushed a commit that referenced this issue Apr 8, 2024
* Remove unwanted doSearch function

As discussed in #3833 the doSearch function doesn't seem necessary and is not contributing
#3833 (comment)

Removing this doesn't change the functionality of the code.

* Undefined checks in js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants