Skip to content

Bugfix/group invite expiry#286

Open
QuickMythril wants to merge 27 commits into
Qortal:masterfrom
QuickMythril:bugfix/group-invite-expiry
Open

Bugfix/group invite expiry#286
QuickMythril wants to merge 27 commits into
Qortal:masterfrom
QuickMythril:bugfix/group-invite-expiry

Conversation

@QuickMythril

Copy link
Copy Markdown

Fixes #285 - Bug: GROUP_INVITE expiration not enforced (invites never expire)

Summary

  • Add the groupInviteExpiryHeight feature trigger (enum entry + getter) and wire it through mainnet, testnet, and all test-chain fixtures; startup now validates the trigger presence.
  • Implement invite expiry enforcement in Group.join(...) gated by the trigger: invite-first joins use join tx timestamps with an inclusive boundary and expiry == null sentinel; expired invites are treated as absent and fall back to join requests; pre-trigger behavior is unchanged. Join-first auto-approvals remain TTL-agnostic (any invite approves a pending request).
  • Apply chain-tip-based invite filtering to API endpoints via a shared helper in GroupsResource (inclusive boundary, expiry == null never expires, skip when no tip) and document the behavior in swagger.
  • Update docs (INVITE_EXPIRATION.md, IMPLEMENTATION.md, CONSENSUS_CHANGE.md) with final semantics, activation plan, join-first clarifications, and activation rollout guidance.
  • Add comprehensive tests: invite-first expiry enforcement, join-first TTL-agnostic behavior, backdated/forward-dated windows, pre/post-trigger activation, and API invite filtering (chain-tip filtering and no-tip fallback). Includes a dedicated GroupInviteFilteringApiTests class.

Tests

  • mvn -q -DskipTests=false -Dtest=org.qortal.test.group.MiscTests test
  • mvn -q -DskipTests=false -Dtest=org.qortal.test.api.GroupInviteFilteringApiTests test

Follow-up for activation

  • Choose and set a real groupInviteExpiryHeight for mainnet once network coverage is sufficient; keep the placeholder until then.
  • Communicate the activation height/date to operators and include it in release notes/changelog.
  • Verify testnet/fixture triggers remain at immediate activation for ongoing coverage, adjusting only if the activation scheme changes.

@nbenaglia

Copy link
Copy Markdown

Docs of this PR should be gathered in a dedicated folder ("group_invite_expiry" for example).
If the docs folder grows up with more documents, it's very difficult to understand to what feature the single document refers to.

@QuickMythril

This comment was marked as abuse.

@QuickMythril

This comment was marked as abuse.

@QuickMythril

This comment was marked as abuse.

@QuickMythril

This comment was marked as abuse.

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.

Bug: GROUP_INVITE expiration not enforced (invites never expire)

2 participants