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 adding state events to the database #3133

Merged
merged 1 commit into from
Jul 4, 2023
Merged

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented Jul 4, 2023

When we're adding state to the database, we check which eventNIDs are already in a block, if we already have that eventNID, we remove it from the list. In its current form we would skip over eventNIDs in the case we already found a match (we're decrementing i twice)
My theory is, that when we later get the state blocks, we are receiving "too many" eventNIDs (well, yea, we stored too many), which may or may not can result in state resets when comparing different state snapshots. (e.g. when adding state we stored a eventNID by accident because we skipped it, later we add more state and are not adding it because we don't skip it)

@S7evinK S7evinK added the T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. label Jul 4, 2023
@S7evinK S7evinK requested a review from a team as a code owner July 4, 2023 07:25
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.05 ⚠️

Comparison is base (2ee03fd) 65.56% compared to head (b1add4c) 65.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3133      +/-   ##
==========================================
- Coverage   65.56%   65.51%   -0.05%     
==========================================
  Files         504      504              
  Lines       56055    56055              
==========================================
- Hits        36751    36727      -24     
- Misses      15517    15531      +14     
- Partials     3787     3797      +10     
Flag Coverage Δ
unittests 49.79% <50.00%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
roomserver/storage/shared/storage.go 67.02% <50.00%> (-0.39%) ⬇️

... and 14 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@S7evinK S7evinK merged commit 4c3a526 into main Jul 4, 2023
18 of 20 checks passed
@S7evinK S7evinK deleted the s7evink/fixaddstate branch July 4, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants