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 bug when removing duplicate rows from user_ips #4434

Merged
merged 4 commits into from Jan 22, 2019

Conversation

Projects
None yet
3 participants
@erikjohnston
Copy link
Member

erikjohnston commented Jan 22, 2019

This was caused by accidentally overwritting a last_seen variable
in a for loop, causing the wrong value to be written to the progress
table. The result of which was that we didn't scan sections of the table
when searching for duplicates, and so some duplicates did not get
deleted.

erikjohnston added some commits Jan 22, 2019

Fix bug when removing duplicate rows from user_ips
This was caused by accidentally overwritting a `last_seen` variable
in a for loop, causing the wrong value to be written to the progress
table. The result of which was that we didn't scan sections of the table
when searching for duplicates, and so some duplicates did not get
deleted.

@erikjohnston erikjohnston requested a review from matrix-org/synapse-core Jan 22, 2019

if row:
return row[0]
else:
return None

This comment has been minimized.

@erikjohnston

erikjohnston Jan 22, 2019

Author Member

This is just moving the row[0] from the if statement below into the function, as it feels cleaner

Show resolved Hide resolved synapse/storage/client_ips.py Outdated
Show resolved Hide resolved synapse/storage/client_ips.py Outdated
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 22, 2019

Codecov Report

Merging #4434 into develop will increase coverage by 0.03%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #4434      +/-   ##
===========================================
+ Coverage    73.68%   73.72%   +0.03%     
===========================================
  Files          300      300              
  Lines        29703    29705       +2     
  Branches      4882     4882              
===========================================
+ Hits         21887    21899      +12     
+ Misses        6386     6378       -8     
+ Partials      1430     1428       -2
@richvdh
Copy link
Member

richvdh left a comment

lgtm

@erikjohnston erikjohnston merged commit 12699a7 into develop Jan 22, 2019

5 checks passed

ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment