Skip to content

Let a person and an organization hold more than one FileMaker code - #2647

Merged
maebeale merged 1 commit into
mainfrom
maebeale/filemaker-code-sets
Oct 12, 2026
Merged

maebeale merged 1 commit into
mainfrom
maebeale/filemaker-code-sets

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 one shared concern replacing a single-value assumption in a deduper, a merge, and five views

A person or organization can come from more than one FileMaker record, and the column already stores them comma-separated — but only Organization read it that way, so a person merge quietly threw one of the two codes away.

What is the goal of this PR and why is this important?

What was broken

  • A person merge kept one code and dropped the other. Both are carried onto the keeper now, the way an org merge already does.
  • PersonServices::DuplicateFinder clustered on the whole column, so 00006 and 00006, 00012 read as two people with conflicting codes instead of one shared code — the opposite of the truth.
  • Five archive links assumed a single value (three person views, two org views). A record carrying two codes lost its link to the archive entirely and rendered as plain text.

How did you approach the change?

  • FilemakerCoded — one concern, included by Person and Organization, owning #filemaker_codes and .join_filemaker_codes. The methods move off Organization, so there's no second copy.
  • filemaker_code_links renders one archive link per code. They now open in a new tab (only one of the five did), so you keep your place on the record page.

Anything else to add?

  • No migration and no backfill. A single code is just a one-element list, so existing rows read the same as before.

🤖 Generated with Claude Code

Organization already treated the column as a comma-separated set and Person
didn't, so one concern now owns the reading and combining for both. A caller
can't compare the whole column against a single code any more, which is what
these three were doing:

- Merging two people kept one code and dropped the other. Both are carried onto
  the keeper now, the way an org merge already does it.
- The person duplicate finder clustered on the whole column, so "00006" and
  "00006, 00012" read as different people with conflicting codes rather than one
  shared code.
- The five archive links assumed a single value, so a person or org carrying two
  codes silently lost its link to the archive. One link per code, each opening
  in its own tab so the record page keeps its place.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/filemaker-code-sets branch from 303a93e to f341c35 Compare October 12, 2026 18:45
@maebeale
maebeale marked this pull request as ready for review October 12, 2026 18:49
@maebeale
maebeale merged commit 25558c6 into main Oct 12, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/filemaker-code-sets branch October 12, 2026 18:54
maebeale added a commit that referenced this pull request Oct 12, 2026
#2647 lets a person carry several codes, so an index built from whole column
values would miss the row whose ID sits inside one and import it again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 12, 2026
#2647 combines both people's codes in merge_keeper; the login sync saves the
keeper early, so pin that the combined codes persist through that path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 12, 2026
#2647 lets a person carry several codes, so an index built from whole column
values would miss the row whose ID sits inside one and import it again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 12, 2026
* Start: sync a merged person's primary email to their login

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Sync a merged person's primary email to a login they take over

Merges move logins with update_all, so #2633's sync never ran when a person
without a login absorbed one: the kept person's primary email stayed out of step
with the login they now sign in with. Sync only when the keeper gains its first
login, matching "linking a login"; a keeper with its own login keeps the email
the admin chose. The preview's edits are saved first so a picked email lands in
the secondary slot, and the preview warns about the swap.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Cover FileMaker codes surviving a merge that takes over a login

#2647 combines both people's codes in merge_keeper; the login sync saves the
keeper early, so pin that the combined codes persist through that path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 12, 2026
#2647 lets a person carry several codes, so an index built from whole column
values would miss the row whose ID sits inside one and import it again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 12, 2026
#2647 lets a person carry several codes, so an index built from whole column
values would miss the row whose ID sits inside one and import it again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 13, 2026
#2647 lets a person carry several codes, so an index built from whole column
values would miss the row whose ID sits inside one and import it again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 15, 2026
#2647 lets a person carry several codes, so an index built from whole column
values would miss the row whose ID sits inside one and import it again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Oct 15, 2026
#2647 lets a person carry several codes, so an index built from whole column
values would miss the row whose ID sits inside one and import it again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant