Skip to content

Fix: editing a page quickly after editing told you it was edited by someone else#349

Merged
TrueBrain merged 1 commit intomainfrom
fix-nonce-git
Aug 1, 2022
Merged

Fix: editing a page quickly after editing told you it was edited by someone else#349
TrueBrain merged 1 commit intomainfrom
fix-nonce-git

Conversation

@TrueBrain
Copy link
Copy Markdown
Owner

This happened because the commit was still pending, so the nonce
was based on the old hash. Especially if there are a few commits
pending to be processed, this could easily happen.

By switching to modified-time of the file, like the local storage
backend does, we solve this problem. And it is safe, as TrueWiki
cannot scale out anyway for nodes that allow editing.

…omeone else

This happened because the commit was still pending, so the nonce
was based on the old hash. Especially if there are a few commits
pending to be processed, this could easily happen.

By switching to modified-time of the file, like the local storage
backend does, we solve this problem. And it is safe, as TrueWiki
cannot scale out anyway for nodes that allow editing.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #349 (2a9912a) into main (2630741) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   80.53%   80.57%   +0.03%     
==========================================
  Files          51       51              
  Lines        2682     2682              
  Branches      436      437       +1     
==========================================
+ Hits         2160     2161       +1     
+ Misses        427      426       -1     
  Partials       95       95              
Impacted Files Coverage Δ
truewiki/storage/git.py 33.64% <ø> (-0.31%) ⬇️
truewiki/storage/local.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2630741...2a9912a. Read the comment docs.

@TrueBrain TrueBrain merged commit 899f935 into main Aug 1, 2022
@TrueBrain TrueBrain deleted the fix-nonce-git branch August 1, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants