Skip to content

client: auto re-invite idle-kicked GC members on return#776

Open
karamble wants to merge 2 commits into
companyzero:masterfrom
karamble:feat-gc-auto-reinvite-idle
Open

client: auto re-invite idle-kicked GC members on return#776
karamble wants to merge 2 commits into
companyzero:masterfrom
karamble:feat-gc-auto-reinvite-idle

Conversation

@karamble

Copy link
Copy Markdown

Depends on #771 (this branch is stacked on fix-gc-dropped-reinvite). The
first commit shown here belongs to #771 and the diff reduces to a single
commit once #771 merges, so this should be merged after it.

What

When auto-remove-idle is enabled (AutoRemoveIdleUsersInterval > 0), a GC
admin now tracks the members it kicks for being idle. If such a member, who
was offline when kicked and so never saw the kick and still believes it is a
member, later sends a GC message, the admin re-adds it and broadcasts the
updated member list instead of silently dropping the message. The returning
member absorbs the new roster through the normal RMGroupList update path; no
invite/accept round trip is needed because the KX survives the kick.

Details

  • New per-GC {GCID}.kickedmembers store, modeled on the existing
    .blocklist, and cleaned up in DeleteGC.
  • The idle-kick is recorded both when the local client kicks (GCKick) and
    when another admin's idle-kick is observed (handleGCKick), so any
    participating admin can later re-add the member.
  • On a GC message from a non-member, handleGCMessage re-adds the member when
    it was idle-kicked, the local client is an admin, and the member is not
    blocked.
  • The whole feature is gated on AutoRemoveIdleUsersInterval > 0, so it is
    inert for deployments that do not auto-remove idle users.

Edge cases

  • Manual (non-idle) kicks and blocked users are never auto-re-added.
  • Concurrent re-adds by multiple admins resolve via the existing
    generation-backtrack guard.
  • Feature disabled: nothing is recorded and nothing is re-added.

Testing

Adds TestGCAutoReinviteIdleKickedMember, which idle-kicks an offline-modeled
member and asserts the admin re-adds and re-broadcasts on the member's next
message; verified it fails without the change. The client package and GC e2e
suite pass.

Closes #726.

karamble added 2 commits June 30, 2026 13:07
handleGCInvite rejected any RMGroupInvite for a GC that already exists locally, storing nothing and firing no notification, so a stale local GC copy (e.g. after restoring an old backup) could never be recovered: the admin re-adds the user by re-inviting, but the invite was always dropped. Store the invite and notify even when the GC exists. The stale roster is refreshed by the normal RMGroupList update (maybeUpdateGC) once the invite is accepted, which already verifies the sender's admin permission and rejects generation backtracks.
When auto-remove-idle is enabled, a GC admin now tracks members it kicked for
being idle. If such a member (who, being offline, never saw the kick and still
believes they are a member) later sends a GC message, the admin re-adds them and
broadcasts the updated member list instead of dropping the message; the returning
member's roster refreshes via the normal RMGroupList update. Manual (non-idle)
kicks and blocked users are never auto-re-added, and concurrent re-adds by
multiple admins resolve via the existing generation guard.

Adds a regression test.
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.

client: track kicked GC members and auto reinvite idle kicks to gc

1 participant