Skip to content

fix(billing): keep archived selected workspaces in the invitation applied-state check - #8159

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/enterprise-invitation-archived-workspace
Sep 22, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/enterprise-invitation-archived-workspace

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The enterprise invitation sweep decides whether a recipient already holds the requested access on every selected workspace before it schedules an invitation. The join that reads that access (introduced with inherited-access handling in fix(organizations): respect inherited access when inviting members #8131) filtered out archived workspaces, while the selection deliberately keeps them: the workspace move carries archived workspaces into the organization so they can be unarchived later, and the preflight lists them as selected
  • For a recipient whose access on an archived selected workspace was already in place, the check therefore read missing instead of applied, scheduled an invitation, and invitation preparation refused the archived workspace; the outbox retried that deterministic refusal until dead-letter. Before fix(organizations): respect inherited access when inviting members #8131 the same recipient read as applied and the sweep converged
  • The join now scopes workspaces to the organization and the selection only, restoring the previous semantics; the join's purpose, carrying the member role for organization-admin inheritance, is unchanged

Out of scope, pre-existing: invitation preparation refuses archived workspaces for genuinely new recipients too. Whether the sweep should grant access on an archived selected workspace or leave it out of invitation requests is a separate decision.

Type of Change

  • Bug fix

Testing

  • New test: a recipient with applied access on the selected workspace completes without an invitation, and the workspace join condition carries the organization and selection scope but no archived filter; it fails if the filter is restored
  • bun run lint, check:audits (47 audits), docs-manifest:check, type-check pass; 62 provisioning tests pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
Image docs Skipped Skipped Sep 22, 2026 8:53pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge and correctly restores convergence for recipients who already have access to archived selected workspaces.

Summary

This PR restores archived selected workspaces to the enterprise invitation applied-state query so recipients with existing access are not sent an invitation that cannot be processed.

  • Removes only the archived-workspace predicate while retaining organization and explicit selection scoping.
  • Preserves the existing organization-admin inheritance and permission checks.
  • Adds regression coverage for both the applied outcome and the workspace join predicate.

Reviews (1) · Last reviewed commit: "fix(billing): keep archived selected wor..."

@waleedlatif1
waleedlatif1 merged commit f492805 into staging Sep 22, 2026
34 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/enterprise-invitation-archived-workspace branch September 22, 2026 20:59

This branch was previously deployed

1 inactive deployment
Preview 4ec508ef Deployed Sep 22, 2026 by vercel[bot]
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