Skip to content

fix: backport detected-country-code metadata fix to v0.3 - #110

Open
23Skidoo wants to merge 2 commits into
whisperfish:v0.3from
23Skidoo:backport-detected-country-metadata-to-v0.3
Open

23Skidoo wants to merge 2 commits into
whisperfish:v0.3from
23Skidoo:backport-detected-country-metadata-to-v0.3

Conversation

@23Skidoo

@23Skidoo 23Skidoo commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Backport of 56bd871 from main. The let chain is rewritten as a match guard, since v0.3 is edition 2021.

On v0.3, parsing an international number under a mismatched reference country strips the wrong national prefix: parse(Some(country::GB), "+390635511397") returns +39635511397 and is_valid reports false, because the metadata comes from the reference country rather than from the country code the number carries. main fixed this in 56bd871; this brings the same fix to the 0.3 line.

Verified on this branch: the full suite passes (98 tests), and the mismatched-hint cases now behave as they do on main.

A second commit raises v0.3's MSRV to 1.79.0, which is the option @jer-gremlin picked in the thread below. c006f1a widened the quick-xml cap to <=0.41 and quick-xml 0.41 requires rustc 1.79, so the 1.76.0 job fails at dependency build on every pull request against v0.3. 1.79.0 is the lowest rustc that satisfies the cap, and it is declared in Cargo.toml, the CI matrix and the README.

Would you consider a 0.3.11 with this in it? We're pinned to a fork solely for this fix. Moving to main isn't an option for us yet because of the memory regression in #107, and you clearly maintain the 0.3 line — c006f1a backported the quick-xml cap here and shipped as 0.3.10 — so a 0.3.x release would let us drop the fork entirely.

Prepared with LLM assistance (Claude Code); I see no policy either way in this repo. The code is @jer-gremlin's, kept as commit author — the only new lines are the match-guard rewrite. Tell me if you'd rather have a commit trailer recording that, or not take LLM-assisted PRs at all.

@codecov

codecov Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v0.3@0a1516e). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             v0.3     #110   +/-   ##
=======================================
  Coverage        ?   67.58%           
=======================================
  Files           ?       18           
  Lines           ?     2147           
  Branches        ?        0           
=======================================
  Hits            ?     1451           
  Misses          ?      696           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Parsing an international number under a mismatched reference country strips the
wrong national prefix, so parse(Some(GB), "+390635511397") yields +39635511397
and is_valid reports false: the metadata came from the reference country rather
than from the country code the number carries.

The let chain is rewritten as a match guard, since v0.3 is edition 2021.

(cherry picked from commit 56bd871)
@23Skidoo
23Skidoo force-pushed the backport-detected-country-metadata-to-v0.3 branch from db42be2 to 8d1d5cb Compare August 19, 2026 11:31
@23Skidoo

23Skidoo commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor Author

The failing cargo test (1.76.0) job isn't from this patch — it fails at dependency build:

error: package `quick-xml v0.41.0` cannot be built because it requires rustc 1.79 or newer,
while the currently active rustc version is 1.76.0

v0.3 declares rust-version = "1.76.0", but c006f1a widened the cap to <=0.41 and quick-xml 0.41 needs 1.79 — so every PR against v0.3 fails that job. This diff touches one file and no dependency.

Fix is either raising v0.3's rust-version to 1.79, or pinning the MSRV job to quick-xml <=0.40. Your call; happy to send either as a one-liner.

@jer-gremlin

Copy link
Copy Markdown
Contributor

@23Skidoo I'm not precious about being the 'authour' of commits etc buddy do whatever you need -- my only goal is better library... for whatever that means in this weird machine overlord era...

@jer-gremlin

Copy link
Copy Markdown
Contributor

The failing cargo test (1.76.0) job isn't from this patch — it fails at dependency build:

error: package `quick-xml v0.41.0` cannot be built because it requires rustc 1.79 or newer,
while the currently active rustc version is 1.76.0

v0.3 declares rust-version = "1.76.0", but c006f1a widened the cap to <=0.41 and quick-xml 0.41 needs 1.79 — so every PR against v0.3 fails that job. This diff touches one file and no dependency.

Fix is either raising v0.3's rust-version to 1.79, or pinning the MSRV job to quick-xml <=0.40. Your call; happy to send either as a one-liner.

I say move to a newer rustc

c006f1a widened the quick-xml cap to <=0.41, and quick-xml 0.41 requires rustc
1.79, so the 1.76.0 job fails at dependency build on every pull request against
v0.3. 1.79.0 is the lowest rustc that satisfies the cap.
@23Skidoo

23Skidoo commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Not hard for me to give credit where it's due. Added a commit bumping rust-version to 1.79.

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