Skip to content

teams: smoother shelfless membership listing - #10396

Draft
Mutugiii wants to merge 2 commits into
masterfrom
claude/teams-fallback-password-cleanup-30snwi
Draft

teams: smoother shelfless membership listing#10396
Mutugiii wants to merge 2 commits into
masterfrom
claude/teams-fallback-password-cleanup-30snwi

Conversation

@Mutugiii

@Mutugiii Mutugiii commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

When fetching the user's shelf returned 404, getMembershipStatus() rethrew, failing the outer forkJoin in getTeams(). The fallback path in the error handler then reloaded teams from scratch: it dropped the membership documents already fetched from the teams database, filtered by this.mode instead of the My Teams rule, and so left My Teams either empty or missing enterprise records.

Changes

  • getMembershipStatus() handles a missing shelf at the source (src/app/teams/teams.component.ts). The 404 is caught inside the shelf couchService.get(...) pipe, which sets userNotInShelf and substitutes of({}). The forkJoin therefore succeeds with the membership docs intact and getTeams() renders through its normal success path, so My Teams includes both team and enterprise records and still identifies memberships and requests. Errors other than 404 are rethrown and reach the existing error handler unchanged.
  • Removed the fallback branch from the getTeams() error handler, now that it is unreachable for a missing shelf.
  • Regression tests in the new src/app/teams/teams.component.spec.ts: a user with a shelf, a user with no shelf document (asserting both team types stay listed, the enterprise membership resolves to member with its original membership doc and isLeader, and the My Teams filter keeps it), and a non-404 shelf error still propagating.
  • Cleanup in src/app/shared/dialogs/change-password.directive.ts: dropped the redundant switchMap(response => of(response)) from updateAdminPassword(), returning the couchService.put(...) observable with its existing catchError directly.

Verification

  • npx ng test --watch=false — 54 files, 364 tests passing.
  • npx ng lint planet-app — clean.
  • Confirmed the regression test has teeth: reverting teams.component.ts to master fails the no-shelf case (expected 1 to be 2 — the old fallback dropped the enterprise row).

master was merged into this branch to resolve conflicts with its quote-props / arrow-body-style lint cleanups, which had touched the same lines; master's unquoted-property style is kept.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QNsUBGvzW85RHmcexWeDQk

Handle a missing shelf document inside getMembershipStatus() instead of
rethrowing it, so the outer forkJoin keeps succeeding and My Teams renders
through the normal success path. Membership docs fetched from the teams
database are retained, both team and enterprise records stay in the table,
and memberships/requests are still identified. Errors other than 404 keep
propagating to the existing error handler.

Also drop the redundant identity switchMap in updateAdminPassword().

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNsUBGvzW85RHmcexWeDQk
@github-actions github-actions Bot added the large 101-200 reviewable lines label Sep 4, 2026
Resolved conflicts in src/app/teams/teams.component.ts and
src/app/shared/dialogs/change-password.directive.ts, where master's lint
cleanups (quote-props, arrow-body-style) touched the same lines. Kept the
in-pipe 404 shelf handling and the removal of the fallback path and the
identity switchMap, adopting master's unquoted property style.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNsUBGvzW85RHmcexWeDQk
@Mutugiii Mutugiii changed the title teams: improve shelf error handling and add component tests teams: smoother shelfless membership listing Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large 101-200 reviewable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants