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

Possible bug - are dataset_preference rows being properly updated? #970

Open
jorvis opened this issue Jan 14, 2025 · 1 comment
Open

Possible bug - are dataset_preference rows being properly updated? #970

jorvis opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jorvis
Copy link
Member

jorvis commented Jan 14, 2025

When the user sets a display preference there might be a bug where a new row is being added rather the existing one being updated. This query should give a single row which is the owner's preference for a single-gene display on an example dataset, but it's returning three rows:

SELECT dd.label, dd.plotly_config
  FROM dataset d
       JOIN dataset_display dd ON d.id = dd.dataset_id
       JOIN dataset_preference dp ON d.id=dp.dataset_id
 WHERE dp.user_id = d.owner_id
   AND dd.user_id = d.owner_id
   AND dp.is_multigene = 0
   AND d.id = 'deb21a3b-677c-13e6-92cc-740fe8505e7c';

It's also worth noting that one of those is clearly a multi-gene configuration, so that also isn't being saved right somewhere (or at least at some point wasn't).

@jorvis jorvis added the bug Something isn't working label Jan 14, 2025
@adkinsrs
Copy link
Member

We discussed this may be a "legacy" issue from an older dataset before code from save_default_display.cgi was fleshed out.

Relevant query from save_default_display.cgi:

        query = """
            INSERT INTO dataset_preference (user_id, dataset_id, display_id, is_multigene)
            VALUES (%s, %s, %s, %s)
            ON DUPLICATE KEY UPDATE display_id = VALUES(display_id);
        """

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants