Repository navigation
chore(release): refresh metadata to v9.0.43 and fix RFC3966 backtracking for 2.1.4 - #459
Merged
Merged
Conversation
Refresh bundled Google libphonenumber metadata from v9.0.42 to v9.0.43 (upstream commit 86ea33cee5c22ab7e23b3de368e7cc7fa439a2b7) and set every Xcode project and podspec version to the patch 2.1.4. Phone-number changes affect BJ, CN, DE, EC, ET, GE, LA, RO, and ZW. Carrier data grows from 32,099 to 32,255 prefix rows. Geocoding changes are limited to en.db (Zimbabwe rows and one Australian prefix) and zh.db (three corrupted Chinese descriptions). Short-number and testing metadata are unchanged, and the timezone rows are byte-identical with only the recorded upstream_ref advancing. Also port Google's fix for catastrophic backtracking in the RFC3966 phone-context domain-name check (google/libphonenumber#4070), along with the upstream testParseRfc3966PhoneContextDomain test. Before the fix the test did not finish within 120 seconds; it now passes in milliseconds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v9.0.42tov9.0.43, and set every Xcode project and podspec to the patch version2.1.4.phone-contextdomain-name check (google/libphonenumber#4070), along with its testtestParseRfc3966PhoneContextDomain.v9.0.43was available. Google master parity failed because the upstream test was missing locally.RFC3966 backtracking fix
The domain-label patterns
[alnum]+((\-)*[alnum])*and[alpha]+((\-)*[alnum])*are ambiguous. On a long, invalidphone-contextsuch asaa.aa.…aa!ora-a-…a!, the regex engine backtracks exponentially.NBPhoneNumberUtil.mnow uses the upstream forms:domainLabel:[alnum]+(\-+[alnum]+)*topLabel:[alpha][alnum]*(\-+[alnum]+)*Each hyphen run must now be followed by an alphanumeric, so the set of accepted domains does not change. With the old pattern, the ported test did not finish within a 120-second timeout. With the new pattern it passes in about 7 ms.
Upstream / Metadata
v9.0.43(86ea33cee5c2); logic frommaster(981600cc587f, #4070)BJ,CN,DE,EC,ET,GE,LA,RO, andZW.upstream_refchanges.en.dbandzh.dbonly.en.db: Zimbabwe (263) rows change, and the Australian prefix61261069is dropped.zh.db: three corrupted86descriptions are fixed.resources/geocodingdiff.Parity Checks
swift scripts/checkUpstreamTestParity.swift --upstream-ref v9.0.43: 173 upstream / 182 local, passedswift scripts/checkUpstreamTestParity.swift --upstream-ref master: 174 upstream / 182 local, passedswift scripts/checkUpstreamAPIParity.swift --upstream-ref v9.0.43and--upstream-ref master: 66 upstream / 93 local, passedswift scripts/checkMetadataFreshness.swift --current-ref v9.0.43 --fail-on-update: up to dateTests
swift test: 232 XCTest cases and 43 Swift Testing tests passedLC_ALL=ko_KR.UTF-8 LANG=ko_KR.UTF-8 swift test: same counts, passedswift build -c releaseswift test --sanitize=thread: not run; no shared state or facade entry point changedxcodebuild test -scheme libPhoneNumber(iPhone 18 Pro / iOS 27.0): 151 tests passedxcodebuild test -scheme libPhoneNumberGeocoding: 20 tests passedxcodebuild test -scheme libPhoneNumberShortNumber: 31 tests passedgit diff --checkThe generated Objective-C gzip array decodes exactly to
generatedJSON/PhoneNumberMetaData.json(254 regions, 351,979 bytes). SQLiteintegrity_checkpasses for the carrier, timezone,en, andzhdatabases.Changelog
CHANGELOG.mdhas a## 2.1.4section, following previous release PRs. Details are indocs/METADATA_UPDATE_LOG.md.Notes
swift scripts/publishPodspecs.swift --linthas not been run for this PR yet.phonenumberutil.jsandphonenumberutil_test.jsagainstmaster. This PR already ports that change.