Loomio sync: a stamp must not outlive the membership #9

Merged
inference-admin merged 1 commits from loomio-reconcile into main 2026-11-22 19:47:22 +00:00
Owner

A member could be stamped as invited but hold no membership, then never be invited again.

Two real cases this fixes:

  • Maykel Moya: joined and accepted Nov 10, membership revoked Nov 14 by the automated (API) removal path during his identity settlement; still active, so the stamp should not have kept him out.
  • Christine Wilson: removed herself from Loomio Nov 20 (revoked by her own user id, account deactivated). She is exempted via loomio_opt_out.

Changes:

  • Stamp only addresses Loomio reports in added_emails (previously every address in the payload was stamped even when Loomio did not add it).
  • Reconcile: clear the stamp for an ACTIVE member stamped-but-absent from the live roster; invite waits one pass so a single stale page cannot trigger it.
  • LOOMIO_RECONCILE_MAX (default 10) caps stamp clearing per pass — more than that means a short roster read, not a mass re-invite.
  • loomio_opt_out column exempts members who left deliberately.
  • Username fix: on 422 "already been taken", try the portal slug then numbered suffixes. Loomio handles are instance-global, so matt (Matthew Lorentz) and every opencollective@… alias collide.

Tests: tests/test_loomio_guard.py 37/37; new tests/test_loomio_usernames.py 8/8; full suite unchanged otherwise (two pre-existing failures on main remain, unrelated).

A member could be stamped as invited but hold no membership, then never be invited again. Two real cases this fixes: - Maykel Moya: joined and accepted Nov 10, membership revoked Nov 14 by the automated (API) removal path during his identity settlement; still active, so the stamp should not have kept him out. - Christine Wilson: removed herself from Loomio Nov 20 (revoked by her own user id, account deactivated). She is exempted via `loomio_opt_out`. Changes: - Stamp only addresses Loomio reports in `added_emails` (previously every address in the payload was stamped even when Loomio did not add it). - Reconcile: clear the stamp for an ACTIVE member stamped-but-absent from the live roster; invite waits one pass so a single stale page cannot trigger it. - `LOOMIO_RECONCILE_MAX` (default 10) caps stamp clearing per pass — more than that means a short roster read, not a mass re-invite. - `loomio_opt_out` column exempts members who left deliberately. - Username fix: on 422 "already been taken", try the portal slug then numbered suffixes. Loomio handles are instance-global, so `matt` (Matthew Lorentz) and every `opencollective@…` alias collide. Tests: `tests/test_loomio_guard.py` 37/37; new `tests/test_loomio_usernames.py` 8/8; full suite unchanged otherwise (two pre-existing failures on main remain, unrelated).
inference-bot added 1 commit 2026-11-22 19:45:31 +00:00
loomio sync: a stamp must not outlive the membership
ci/woodpecker/push/woodpecker Pipeline failed
ffed06d492
The invite stamp meant 'handed to Loomio once, EVER', so a member whose
membership was later revoked (a lapse that was reversed) or who deleted
their Loomio account was recorded as invited and never invited again.

- Stamp only the addresses Loomio actually returns in added_emails; an
  address accepted in the payload but not added stays eligible.
- Clear the stamp for an ACTIVE member stamped-but-absent from the live
  roster; the invite itself waits one pass so a single stale page cannot
  become an invite.
- Cap stamp clearing per pass (LOOMIO_RECONCILE_MAX, default 10): more
  stamped-but-absent members means a short roster read, not a mass
  re-invite.
- loomio_opt_out exempts members who deliberately left.
- Username fix falls back to the portal slug when a handle is already
  taken (Loomio handles are instance-global; every OC alias resolves to
  opencollective).
inference-bot requested review from inference-admin 2026-11-22 19:45:36 +00:00
inference-admin merged commit f09bec67d8 into main 2026-11-22 19:47:22 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: code/member-portal#9