Skip to content

tracking: observe asynchronous invitation attribution in lifecycle test #447

Backlog

Description

@voidvec

Problem

The invitation registration lifecycle test can read last_used_by before its best-effort asynchronous attribution update commits. An HTTP registration success does not guarantee completion of that separate update, so the immediate assertion can fail despite the synchronous use reservation succeeding.

Evidence

  • Baseline c136458 and F0 head f5da60d contain identical registration product code and test code.
  • Feature run 47330900463, job 145033962819 (Social OFF / WebAuthn ON), failed only Integration_P2_AdminRegistrationInvitation_GateLifecycle: used_count == 1 passed, while last_used_by IS NOT NULL was f at AdminRegistrationInvitationHttpTest.cc:319.
  • RegistrationInvitationService.h:79 documents best-effort attribution. Its implementation performs asynchronous user lookup and attribution UPDATE; SessionController sends the success response without awaiting completion.
  • The same test already observes asynchronous audit writes with a two-second steady-clock window and 25 ms read intervals.
  • The failure establishes the observed state, not that attribution subsequently succeeded. The original failed artifact remains evidence.

Suggested fix

Observe only this owned invitation's attribution using the existing read query. Poll for at most the existing two-second observation window, only while the row has two columns, use count is exactly one, and attribution is false. Retain every original assertion and add a two-column guard before indexing. Reject malformed/missing rows, SQL failures and incorrect counts without observation retries.

Acceptance criteria

  • Change only the local observation block; registration/revocation requests are never retried.
  • All original count, attribution, authorization, audit and concurrency assertions remain intact.
  • Permanent attribution failure still fails at the final assertion; no global timeout increase or product behavior change.
  • Removing the local replacement reconstructs the entire baseline test byte-for-byte.
  • Independent review and fresh-head complete CI, including the failing feature combination and full test binary, pass.

Out of scope / follow-ups

No registration transaction/latency contract, best-effort product policy, other test fixtures, coverage thresholds or CI timeout changes. This bounded test-only fix is the independently reviewed R3 amendment to F0 #445 under the v1.8.0 plan #417.

Activity

  1. added
    tracking
    on Dec 4, 2026
  2. added a commit that references this issue on Dec 4, 2026
    aa3ea97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions