Skip to content

fix(alarms): strip only paired markdown, and three loose ends - #823

Merged
hokiepokedad2 merged 5 commits into
developfrom
fix/post-merge-followups
Aug 24, 2026
Merged

fix(alarms): strip only paired markdown, and three loose ends#823
hokiepokedad2 merged 5 commits into
developfrom
fix/post-merge-followups

Conversation

@hokiepokedad2

Copy link
Copy Markdown
Contributor

Four small things left behind by today's nine merges. One commit each so they read independently.

1. cleanRuleSummary stripped markdown characters that were not markdown — 73b554c

Flagged by #819. The old body was .replace(/[*_]/g, ''): every delimiter character, anywhere. Nothing in production descriptions contains one today, but **area names and saved-place labels routinely do** — work_gymwould have silently becomeworkgym` the first time Poracle rendered one into a sentence.

Stripping now runs in pairs: code spans first, then **bold**, *italic*, __underline__, _italic_. The underscore forms carry (?<!\w) / (?!\w) lookarounds, the same boundary Discord itself applies, so work_gym survives and a real _italic_ still loses its delimiters.

Checked against the live 5.2.1 server rather than assumed: all 19 descriptions across fort, invasion, lure, pokemon and quest use ** and nothing else, and every one survives the new function unchanged. processor/internal/rowtext/*.go agrees — ** is the only markup PoracleNG emits.

The underscore test was red before the fix (my_templatemytemplate); the paired-emphasis test is its legitimate-case twin.

2. The active-hours language-switch bug does not exist — 267e107

I reported this one and I was wrong, so this commit adds a guard rather than a fix.

The claim was that ActiveHoursChipComponent calls translate.instant() inside a computed(), which cannot see a language change. That was true on ngx-translate ≤17. This repo has been on v18 since #377, well before #816, and v18 backs its store with signals: instant() reads _currentLang and _translations, so calling it inside a computed() registers them as dependencies and a language switch invalidates the labels like any other signal read.

Verified twice — a probe counting recomputations across use('en')use('it'), and the component's own test passing unmodified.

So the new test switches language through I18nService.use(), the path the language menu actually takes, and asserts the pill text goes from "hourly" to "ogni ora". It can be made red: wrapping the instant() call in untracked() — the shape a future ngx-translate dropping those signal reads would produce — fails it. A comment names the route so nobody files this again.

No changelog entry: nothing changed for users and there was no defect.

3. isStardust removed — 5864e63

Genuinely dead: usesRewardSlot took the template over in #821 and isStardust was read only by its own two assertions. Both assertions are kept, retargeted at usesRewardSlot — on a stardust rule that is the flag putting the floor field on screen, and in the pokémon-encounter case it is the flag stopping reward being overwritten on save. Same coverage, pointed at the property that is load-bearing. isPokecoins stays live; STARDUST stays because REWARD_SLOT_TYPES is built from it.

4. The [Unreleased] section had duplicate headings — e7df068

My fault, and worth fixing before a release rather than after. Squash-merging nine branches in a row left the section with two ### Added blocks and two ### Changed blocks: each merge resolved its CHANGELOG conflict by keeping both sides, which is right for the bullets and wrong for the heading above them. The release workflow promotes the section verbatim, so the published notes would have carried the duplicates.

All fifteen bullets are unchanged and still present; only the headings are merged, into Keep a Changelog's order.

Verification

npx jest --ci — 116 suites, 1392 tests (was 1389; three new). Production ng build succeeds. eslint and prettier --check clean on every file touched. No backend files changed. Seven files, +73/−14, no line-ending churn.

Noticed, out of scope

  • prettier --check fails on CHANGELOG.md at baseline, before any change here. It sits outside the configured scope (src/**/*.{ts,html,scss}) so CI never sees it, but running prettier from the repo root trips on it.
  • cleanRuleSummary's fort case is still poorFort updates: pokestop | distance: 5000m ["name"] keeps a raw JSON array mid-sentence, which is why fort cards do not render the line at all. Fixing it means translating change_types client-side, which is a feature rather than a cleanup.

cleanRuleSummary removed every asterisk, underscore and backtick in the
string. PoracleNG's rowtext emits only **bold** today, so nothing on screen
changes -- but it interpolates template names, areas and saved-place labels
into that sentence unescaped, and work_gym is a name, not italics.

Stripping is now pair-aware: code spans first (a backtick pair wins over
emphasis inside it), then **bold**, *italic*, __underline__ and _italic_.
The two underscore forms additionally require a non-word character outside
the delimiter, which is the boundary Discord itself applies, so an
underscore between two word characters is left alone.

Verified against PoracleNG 5.2.1 on the dev instance: every live description
returned by /api/tracking/allProfiles?includeDescriptions=true uses ** and
nothing else, and all of them come through unchanged.
Reported as a defect from #816: the pill labels call translate.instant
inside a computed, instant is not a signal, so a language switch should
leave already-rendered pills in the previous language.

It does not, and the reason is worth writing down rather than papering
over. @ngx-translate v18 backs its store with signals, and instant() reads
_currentLang and _translations on the way to a value -- so calling it
inside a computed registers them as dependencies and the labels invalidate
on a switch like any other signal read. The premise held on the versions
before v18; this repo has been on v18 since #377, well before #816.

So: no behaviour change, because there is no defect to fix. What was
missing is the guard. The new spec switches language through I18nService,
the path the language menu takes, and asserts the rendered pill follows.
Confirmed it goes red when the instant() call is wrapped in untracked(),
which is exactly the shape a future ngx-translate dropping those signal
reads would produce.
usesRewardSlot took over in the template when #821 gave pokecoins the same
control, and nothing else read isStardust -- only its own two assertions,
which is a property kept alive by the test that tests it.

The assertions were worth keeping, so they now name usesRewardSlot: on a
stardust rule it is the flag that puts the floor field on screen, and on
the pokemon-encounter twin it is the flag that keeps reward from being
overwritten on save. STARDUST stays, REWARD_SLOT_TYPES is built from it.
Squash-merging nine branches in a row left the section with two Added blocks and
two Changed blocks. Each merge resolved its CHANGELOG conflict by keeping both
sides, which is right for the bullets and wrong for the heading above them.

The release workflow promotes this section verbatim, so the published notes would
have carried the duplicates.

Bullets are unchanged and all fifteen are still here; only the headings are merged,
into Keep a Changelog's order.
@hokiepokedad2
hokiepokedad2 merged commit 28c84bc into develop Aug 24, 2026
6 checks passed
@hokiepokedad2
hokiepokedad2 deleted the fix/post-merge-followups branch August 24, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant