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

Cache key collision in render checks for suggestions #12673

Merged
merged 3 commits into from
Oct 5, 2024

Conversation

vinceh121
Copy link
Contributor

Proposed changes

There is a cache key collision between renders generated in checks for the unit and for its suggestions.

How to reproduce the collision:

  1. Create a component with the max-size check
  2. Create a unit in the source language and translate it in a target language
  3. The render check (whether valid or incorrect) will display the render for the target string
  4. Add a different suggestion to the same unit
  5. The render check will display the render for the suggestion instead of the target string

Checklist

  • Lint and unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • I have squashed my commits into logic units.
  • I have described the changes in the commit messages.

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.14%. Comparing base (8d08fc0) to head (119b46f).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
weblate/trans/models/suggestion.py 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12673      +/-   ##
==========================================
- Coverage   91.14%   91.14%   -0.01%     
==========================================
  Files         596      596              
  Lines       60939    60940       +1     
  Branches     9646     9646              
==========================================
  Hits        55545    55545              
- Misses       3723     3724       +1     
  Partials     1671     1671              
Files with missing lines Coverage Δ
weblate/trans/models/suggestion.py 80.00% <0.00%> (-0.60%) ⬇️

weblate/checks/base.py Outdated Show resolved Hide resolved
@vinceh121 vinceh121 requested a review from nijel October 4, 2024 17:49
@vinceh121 vinceh121 changed the title fix: use suggestion ID in render cache key Cache key collision in render checks for suggestions Oct 4, 2024
@nijel nijel merged commit d31f719 into WeblateOrg:main Oct 5, 2024
33 of 34 checks passed
@nijel nijel added this to the 5.8 milestone Oct 5, 2024
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