Skip to content

fix(cp): drop a dangling trailing dash before deriving Long Name - #331

Merged
netravnen merged 1 commit into
masterfrom
fix/cp-long-name-trailing-dash
Nov 26, 2026
Merged

netravnen merged 1 commit into
masterfrom
fix/cp-long-name-trailing-dash

Conversation

@netravnen

@netravnen netravnen commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Follows #330 (merged). Update Name no longer writes a cut-off name with a dangling dash into Long Name.

Why

Net 25126 / org 45040 (AS266063, BR) gets its RDAP data from registro.br, which cuts owner names at 50 characters. The org name is <COMPANY> SERVICOS DE COMUNICACAO MULTIMIDIA -, exactly 50 characters. Comparable orgs end in MULTIMIDIA - ME or MULTIMIDIA - EIRELI, so the legal form after the dash was lost. The short Name already came out clean, but compactEntityNameWithLongNameFallback kept the dash in the full name and wrote ... MULTIMIDIA - to Long Name.

Change

compactEntityNameWithLongNameFallback drops a trailing spaced -, –, — or /, also after a comma, along with the dangling , and ; it already drops.

Input Name Long Name
EXAMPLE SERVICOS DE COMUNICACAO MULTIMIDIA - EXAMPLE SERVICOS DE COMUNICACAO MULTIMIDIA empty (was the input)
Example Net, - Example Net empty
Example Multimidia - ME unchanged unchanged
Foo - Bar unchanged unchanged

The lost legal form is not guessed. Set it by hand once the CNPJ is checked.

Testing

  • build_userscripts.py --check and node --check pass.
  • node --test: 641 tests, 640 pass, 1 skipped, 0 fail. The new tests use placeholder data.
  • The scratch name-normalization harnesses give identical output to master.

Notes

Assisted-by: Claude:claude-opus-5-5

registro.br cuts owner names at 50 characters, so a name like
"<COMPANY> SERVICOS DE COMUNICACAO MULTIMIDIA - ME" arrives as
"... MULTIMIDIA -" (net 25126 / org 45040, AS266063). The short Name
was already clean, but compactEntityNameWithLongNameFallback kept the
dash in the full name and wrote "... MULTIMIDIA -" to Long Name.

Changes:
- compactEntityNameWithLongNameFallback drops a trailing spaced "-",
  en dash, em dash or "/" (also after a comma) along with the
  dangling "," and ";" it already drops. An unspaced "Foo-" and a
  real suffix after the dash ("... - ME") are unchanged.
- Bump CP to 2.0.237.

Security:
- N/A

Testing:
- New tests on placeholder data for the cut-off shape, each dash
  form, and the unchanged suffix and unspaced cases.
- build_userscripts.py --check and node --check pass.
- node --test in user.js: 641 tests, 640 pass, 1 skipped, 0 fail.
- The 9 scratch name-normalization harnesses give identical output to
  master.

Backwards Compatibility:
- Only names ending in a spaced dangling dash or slash change: their
  Long Name loses the separator or is no longer written.

Assisted-by: Claude:claude-opus-5-5
@netravnen netravnen added bug llm-built userscript Tampermonkey/Greasemonkey userscript changes labels Nov 25, 2026
@netravnen
netravnen changed the base branch from fix/cp-rdap-remark-joined-name to master November 25, 2026 21:20
@netravnen
netravnen merged commit 94e51f2 into master Nov 26, 2026
2 checks passed
@netravnen
netravnen deleted the fix/cp-long-name-trailing-dash branch November 26, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug llm-built userscript Tampermonkey/Greasemonkey userscript changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant