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

Fix: advanced search or date searching + doc type/correspondent/storage path broken #3209

Merged
merged 2 commits into from Apr 27, 2023

Conversation

shamoon
Copy link
Member

@shamoon shamoon commented Apr 27, 2023

Proposed change

This is because of #2893 because the new query vars are object__id__in and object__id__none which weren't included in the list when using whoosh searches (e.g. date or advanced search)

Fixes #3206

Screenshot 2023-04-27 at 7 59 49 AM

Screenshot 2023-04-27 at 7 59 45 AM

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please explain)

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

@shamoon shamoon requested a review from a team as a code owner April 27, 2023 15:11
@paperless-ngx-secretary paperless-ngx-secretary bot added backend non-trivial Requires approval by several team members labels Apr 27, 2023
@github-actions github-actions bot added the bug Bug report or a Bug-fix label Apr 27, 2023
@shamoon shamoon added this to the v1.14.2 milestone Apr 27, 2023
@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Merging #3209 (1a1cf49) into dev (d3e1481) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev    #3209      +/-   ##
==========================================
+ Coverage   93.32%   93.34%   +0.01%     
==========================================
  Files         156      156              
  Lines        6638     6656      +18     
==========================================
+ Hits         6195     6213      +18     
  Misses        443      443              
Flag Coverage Δ
backend 93.34% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/documents/index.py 94.35% <100.00%> (+0.57%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shamoon shamoon merged commit deaff29 into dev Apr 27, 2023
29 checks passed
@shamoon shamoon deleted the fix/issue-3206 branch April 27, 2023 17:09
@Skram-de
Copy link

Skram-de commented Apr 27, 2023

Thank you for merging & publishing that fast.
But the fix isn't working in V1.14.2 (after reindexing), please re-open.
image

"added last year" selected leads to an empty result set this time:
image

@shamoon
Copy link
Member Author

shamoon commented Apr 27, 2023

Hmm, make sure you re-create your container (not restart), etc. does seem to work for me:

Screenshot 2023-04-27 at 12 00 18 PM

Screenshot 2023-04-27 at 12 01 17 PM

I also added tests for this so I do think its fixed, but let us know...

@Skram-de
Copy link

Skram-de commented Apr 27, 2023

I recreated the container before.
image

Behaviour changed from "ignoring document type" as in #3206 to "empty result set" in V1.14.2. (see above)

  • Combination of "document type" & "storage path" works.
  • Combination of "document type" & "after date" works.

image

"Last year" without any second parameter also works fine.

@Skram-de
Copy link

Skram-de commented Apr 27, 2023

@shamoon , apply an owner to the documents!
Docs without an owner are shown.
Docs with owner set will hide. That's what leads to an empty result set with my data.

@shamoon
Copy link
Member Author

shamoon commented Apr 27, 2023

Hmm, still cant reproduce on my end, sample-50-MB-pdf-file here has an owner

Screenshot 2023-04-27 at 12 48 58 PM

@shamoon
Copy link
Member Author

shamoon commented Apr 27, 2023

I see the issue, a document you dont own but have view permissions on

It's kind of related but not the same issue, believe it or not. Tracking in #3221

@Skram-de
Copy link

yeah, that's it, can reproduce!
=> document I dont own but have view permissions on

@Skram-de
Copy link

Even if my bug description was a bit of nitpicking:
Adding multi-user-permissions to this project was really, really great work!

@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend bug Bug report or a Bug-fix non-trivial Requires approval by several team members
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Selecting date ranges breaks searches
3 participants