babel icon indicating copy to clipboard operation
babel copied to clipboard

Fix the way obsolete messages are stored

Open tomasr8 opened this issue 1 year ago • 1 comments

Closes #1124

Previously, the Catalog.obsolete dictionary would use the msgid as a key to store messages. When there are two messages with the same id but a different context, the latter one overwrites the former.

The fix is to use Catalog._get_key as the key, same as for _messages.

This might be considered a breaking change, however the only documentation for Catalog.obsolete is this: image

The docs never say anything about how the keys are computed, so I think it should be safe to make this change (and perhaps document it too?)

tomasr8 avatar Sep 23 '24 16:09 tomasr8

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.31%. Comparing base (f91754b) to head (efea1fe). Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1132      +/-   ##
==========================================
+ Coverage   91.26%   91.31%   +0.05%     
==========================================
  Files          27       27              
  Lines        4602     4618      +16     
==========================================
+ Hits         4200     4217      +17     
+ Misses        402      401       -1     
Flag Coverage Δ
macos-12-3.10 90.08% <100.00%> (+0.01%) :arrow_up:
macos-12-3.11 90.01% <100.00%> (+0.01%) :arrow_up:
macos-12-3.12 90.23% <100.00%> (+0.05%) :arrow_up:
macos-12-3.13-dev 89.75% <100.00%> (+0.05%) :arrow_up:
macos-12-3.8 90.01% <100.00%> (+0.01%) :arrow_up:
macos-12-3.9 90.01% <100.00%> (+0.01%) :arrow_up:
macos-12-pypy3.10 90.08% <100.00%> (+0.01%) :arrow_up:
ubuntu-22.04-3.10 90.10% <100.00%> (+0.01%) :arrow_up:
ubuntu-22.04-3.11 90.03% <100.00%> (+0.01%) :arrow_up:
ubuntu-22.04-3.12 90.25% <100.00%> (+0.05%) :arrow_up:
ubuntu-22.04-3.13-dev 89.77% <100.00%> (+0.05%) :arrow_up:
ubuntu-22.04-3.8 90.03% <100.00%> (+0.01%) :arrow_up:
ubuntu-22.04-3.9 90.03% <100.00%> (+0.01%) :arrow_up:
ubuntu-22.04-pypy3.10 90.10% <100.00%> (+0.01%) :arrow_up:
windows-2022-3.10 90.22% <100.00%> (+0.01%) :arrow_up:
windows-2022-3.11 90.15% <100.00%> (+0.01%) :arrow_up:
windows-2022-3.12 90.37% <100.00%> (+0.05%) :arrow_up:
windows-2022-3.13-dev 89.89% <100.00%> (+0.05%) :arrow_up:
windows-2022-3.8 90.15% <100.00%> (+0.01%) :arrow_up:
windows-2022-3.9 90.15% <100.00%> (+0.01%) :arrow_up:
windows-2022-pypy3.10 90.22% <100.00%> (+0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 23 '24 16:09 codecov[bot]