The conflict sheet calls a rule copied by hand with its id kept a rename of the original

Closed
#201 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #226 by @JWhite212 — merged

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
swift
Domain
backend

Research direction

Read Sources/NotificationCore/RulesDocument.swift around RulesDocument.takeRenames and inspect the existing cases in Tests/NotificationCoreTests/ConflictSheetTests.swift. Add a case for an unchanged-name rule copied with the same id, and verify it is counted as added while id-based renames still pair. Run the pinned Swift build and test commands; update CHANGELOG.md as listed.

Written by the indexing model from the issue text.

Description

bug

Audit row: B22, Defects (added by #193). Line numbers are those of 4553590. Find the code by what it says, and re-run every pin command on the branch point.

What is wrong. RulesDocument.takeRenames pairs a rule in the new file with one in the old by id only when their names differ (RulesDocument.swift:239-260). With the names equal it moves on without taking the old rule out, so a copy of it, renamed and with the same id, pairs with it. A scratch program: before [A(id1)], after [A(id1), B(id1)] gives "Added: “A”. Renamed: “A” to “B”.", where the file added B. The loader refuses that file's copy for its duplicate id.

Behaviour that must survive. Renames are paired by id. A copy with the same name and id is counted as added.

The change. An old rule whose id matches is taken out of the pairing whether or not its name changed. Owner after: RulesDocument.takeRenames.

In scope: Sources/NotificationCore/RulesDocument.swift, one new case in Tests/NotificationCoreTests/ConflictSheetTests.swift, CHANGELOG.md.

Out of scope, however tempting: changedNames and isReordered, and the sheet's sentences.

Frozen side: the tests. Every existing test passes unchanged; new tests are added.

Pins (counts at 4553590):

  • grep -rn 'takeRenames\|RulesChange' Tests | wc -l → 47, through ConflictSheetTests, RulesDocumentTests and DryRunTests.

Check, on the branch:

  • swift build --build-tests -Xswiftc -warnings-as-errors: no warning.
  • swift test --skip-build: 0 failures, at the branch point's count plus the new tests (state both in the pull request).
  • Each new test is seen to fail once against the code as it was.

Stop, and say so here before going on, if: the code cited has already changed; a pin appears that is not listed; a file outside the scope is needed; or any existing test would have to change.

Hold: not merged before v1.1.0 is tagged (owner, 2026-11-06). It changes the app's code, and a code change restarts the go/no-go bar's two weeks.

Prevention: Guard added: the case above.

Size: S.

Dominant language
Swift
Stars
2
Forks
0
Avg merge
1h 7m
Merged PRs (30d)
152

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JWhite212/SignalLadder

All issues in JWhite212/SignalLadder

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.