≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1546

Bug #1546: Issue filtering doesn't work when logged in

Kind bug
Product wincent.dev
When Created 2010-04-28T15:06:33Z, updated 2010-06-10T06:33:53Z
Status closed
Reporter Michael Henry
Tags no tags

Description

Hello, Wincent,

I signed up for an account on wincent.dev due to my interest in your Command-T plugin. When I'm not logged in, I'm able to use this URL to see issues related only to this plugin: https://wincent.dev/issues?product=Command-T

When I'm logged in and using the same URL as above, the filtering doesn't seem to work, and I'm presented with what appear to be issues from all of your products.

I'm using Firefox-3.6.3 on Arch Linux.

Thanks, Michael Henry

Comments

  1. Greg Hurrell 2010-04-28T15:39:55Z

    Thanks a lot for the report. Wouldn't have noticed myself as it works for me when logged in (admin account), and also when not logged in; when I log in on a normal account I can reproduce it.

  2. Greg Hurrell 2010-04-28T15:42:54Z

    I notice the same thing happens using the issue search and selecting a product from the pop-up.

    Works for admin account and anonymous visitor, but doesn't work for logged-in normal accounts.

    Not just on product field either; exactly the same behavior for the status and the kind pop-ups as well.

  3. Greg Hurrell 2010-04-28T15:56:49Z

    Ok, think I've found the cause of the bug. It's an operator precedence thing.

    The SELECT query that gets built up for admin users ends up including:

    awaiting_moderation = FALSE

    And for anonymous users it ends up being:

    awaiting_moderation = FALSE AND public = TRUE

    While for logged-in, normal users it ends up being:

    awaiting_moderation = FALSE AND public = TRUE OR user_id = 20

    As AND has higher precedence than OR, that's equivalent to:

    (awaiting_moderation = FALSE AND public = TRUE) OR user_id = 20

    When it really should be forced to be the opposite via parentheses:

    awaiting_moderation = FALSE AND (public = TRUE OR user_id = 20)

    That's my hunch, anyway, going to see if I can whip up some failing tests, try out the fix, and see if that makes the tests pass.

    I'm in the middle of some rather invasive changes right now (trying out Rails 3), thank goodness Git makes this kind of thing easy (git stash, git rebase etc).

  4. Greg Hurrell 2010-06-10T06:33:42Z

    Ok, finally got the Rails 3 stuff under the control (it was painful) to the point where I can look at other bugs. This one is now fixed in the rails3 branch, so will get deployed after a lot of testing... (most likely won't deploy a Rails 3 version of the site until Rails 3.0.1 or 3.0.2 has been out in the field for a while).

  5. Greg Hurrell 2010-06-10T06:33:53Z

    Status changed:

    • From: new
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets