Skip to content

fix(station,wallet): remove a deleted user group from its members - #675

Merged
sea-snake merged 8 commits into
mainfrom
arshavir/intelligent-tesla-eif3yb
Nov 3, 2026
Merged

sea-snake merged 8 commits into
mainfrom
arshavir/intelligent-tesla-eif3yb

Conversation

@aterga

@aterga aterga commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Station: removing a user group now also removes it from the users that are still members of it, including inactive users, so no user record keeps referencing a group that no longer exists.
  • Station: on upgrade, user records drop the ids of user groups that no longer exist. This cleans up groups that were removed before this change. It runs right after the caches are built in upgrade_canister, since the repositories read from the cache.
  • Wallet: the remove confirmation on the User Groups page, and remove user group requests that haven't executed yet, list the users that are still members: "Removing this group will affect users A, B who are still members of it." It lists up to 10 names plus a count of the rest, and falls back to a generic message if the members can't be loaded.

Testing

  • Station: new unit tests for removing a group with active and inactive members, and for the upgrade cleanup. All 411 station unit tests pass; cargo fmt, clippy and the wasm build are clean.
  • Wallet: new spec for the warning (one member, several members, more than 10 members, no members, members can't be loaded). The full wallet suite passes; prettier, eslint and vue-tsc are clean.

The French and Portuguese strings would benefit from a native speaker's review.


Generated by Claude Code

Removing a user group now also removes it from the users that are still
members of it, including inactive users. On upgrade, the station also
drops the ids of user groups that no longer exist from user records, so
user records stay consistent with the existing user groups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011s2DjdDkqmvLbmPneUM22j
The remove confirmation and pending remove user group requests now list
the users that are still members of the group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011s2DjdDkqmvLbmPneUM22j
Copilot AI balanced review requested due to automatic review settings October 23, 2026 10:26

Copilot AI 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.

🟡 Changes recommended

Membership warnings can disappear during loading or understate the impact when permissions hide affected users.

2 open issues
What changed in this PR

This PR keeps station user memberships consistent when groups are deleted and adds wallet warnings about affected members.

Changes:

  • Remove deleted groups from active and inactive users, and clean up stale memberships during upgrades.
  • Show localized membership warnings in removal confirmations and pending removal requests.
  • Add station cleanup tests and wallet warning tests.
File Description
core/​station/​impl/​src/​services/​user_group.rs Remove memberships on group deletion and test cleanup.
core/​station/​impl/​src/​services/​system.rs Clean up missing group references after upgrade cache initialization.
apps/​wallet/​src/​pages/​UserGroupsPage.vue Add membership warnings to removal confirmations.
apps/​wallet/​src/​locales/​pt.locale.ts Add Portuguese warning messages.
apps/​wallet/​src/​locales/​fr.locale.ts Add French warning messages.
apps/​wallet/​src/​locales/​en.locale.ts Add English warning messages.
apps/​wallet/​src/​components/​users/​UserGroupMembersWarning.vue Fetch and display affected members with a fallback warning.
apps/​wallet/​src/​components/​users/​UserGroupMembersWarning.spec.ts Test warning text, counts, empty results, and lookup failures.
apps/​wallet/​src/​components/​requests/​operations/​RemoveUserGroupOperation.vue Show warnings for removal requests awaiting execution.

Review effort: Balanced

claude and others added 2 commits October 23, 2026 10:36
…oaded

The confirmation can be submitted before the member lookup finishes, so
the generic warning is shown until the members are loaded instead of no
warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011s2DjdDkqmvLbmPneUM22j
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sea-snake
sea-snake marked this pull request as ready for review November 2, 2026 12:14
@sea-snake
sea-snake requested a review from a team as a code owner November 2, 2026 12:14
@zeropath-ai

zeropath-ai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 9a01a9e.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► apps/wallet/src/components/requests/operations/RemoveUserGroupOperation.vue
    Modify template to show UserGroupMembersWarning when not loading and add warning component; wrap existing component with additional div and conditionals
► apps/wallet/src/components/users/UserGroupMembersWarning.vue
    Add new warning component to display members affected by group removal
► apps/wallet/src/pages/UserGroupsPage.vue
    Include UserGroupMembersWarning inside confirmation dialog for removal action

@sea-snake
sea-snake enabled auto-merge (squash) November 3, 2026 12:22
…tesla-eif3yb

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011s2DjdDkqmvLbmPneUM22j
@sea-snake
sea-snake merged commit 3786122 into main Nov 3, 2026
29 checks passed
@sea-snake
sea-snake deleted the arshavir/intelligent-tesla-eif3yb branch November 3, 2026 13:24
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.

4 participants