-
Notifications
You must be signed in to change notification settings - Fork 687
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
create submission files and seen data #5580
Conversation
e013e05
to
7a5bd3e
Compare
7a5bd3e
to
b782ef4
Compare
abc54fc
to
061ebcb
Compare
This pull request introduces 1 alert when merging 061ebcb into a0b53d3 - view on LGTM.com new alerts:
|
I added one more commit that adds seen data so that a third of sources created are marked as seen (all their submissions are seen), a third of sources are unseen (with half their submissions seen), and a third of sources are unseen (with zero submissions seen, although the replies to these source will have been seen, since all replies are seen). You can verify this works by confirming
|
061ebcb
to
ed0479f
Compare
(once #5503 is resolved we can get rid of the id column and make the primary key equal the two foreign keys, which has the benefit of making sql results easier to read) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected in the dev environment and also CI is green. I can create my user easily in staging.
Tested steps from the PR:
make dev
- confirm you see that 3 journalists were created by checkout stdout logs
- log into the client
- there are 3 sources, each with 2 messages, 2 files, and 2 replies
docker exec -it securedrop-dev-0 bash
sqlite3 /var/lib/securedrop/db.sqlite
- confirm one source has 0 seen messages and 0 seen files by making sure submission ids 1,2,3,4 are not in the seen tables (should look like the sql results below)
- confirm one source has all their messages and files seen by making sure submission ids 5,6,7,8 are in the seen tables (should look like the sql results below)
- confirm one source has 1 message and 1 file seen by making sure submission ids 9,11 are in the seen tables (should look like the sql results below)
sqlite> select * from seen_files;
1|7|1
2|8|1
3|11|1
sqlite> select * from seen_messages;
1|5|1
2|6|1
3|9|1
- confirm that each sender of a reply has a seen record in the
seen_replies
table: one source has two replies sent by the deleted user (so journalist_id will be null), the rest of the sources have replies sent bydellsberg
withjournalist_id=2
- confirm that one source has 0 replies seen by
journalist
withjournalist_id=1
by making sure(reply_id, journalist_id) = (1, 1)
and(reply_id, journalist_id) = (2, 1)
does not exist - confirm that one source has both replies seen by
journalist
withjournalist_id=1
by making sure(reply_id, journalist_id) = (3, 1)
and(reply_id, journalist_id) = (4, 1)
does exist - confirm that one source has only one reply seen by
journalist
withjournalist_id=1
by making sure(reply_id, journalist_id) = (5, 1)
exists and(reply_id, journalist_id) = (6, 1)
does not exist - the results should look like the following:
sqlite> select * from seen_replies;
1|1|
2|2|
3|3|2
4|3|1
5|4|2
6|4|1
7|5|2
8|5|1
9|6|2
Description of Changes
Fixes #5451
Partially resolves: #5514