teams: smoother shelfless membership listing - #10396
Draft
Mutugiii wants to merge 2 commits into
Draft
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When fetching the user's shelf returned 404,
getMembershipStatus()rethrew, failing the outerforkJoiningetTeams(). The fallback path in the error handler then reloaded teams from scratch: it dropped the membership documents already fetched from theteamsdatabase, filtered bythis.modeinstead 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 shelfcouchService.get(...)pipe, which setsuserNotInShelfand substitutesof({}). TheforkJointherefore succeeds with the membership docs intact andgetTeams()renders through its normal success path, so My Teams includes bothteamandenterpriserecords and still identifies memberships and requests. Errors other than 404 are rethrown and reach the existing error handler unchanged.getTeams()error handler, now that it is unreachable for a missing shelf.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 tomemberwith its original membership doc andisLeader, and the My Teams filter keeps it), and a non-404 shelf error still propagating.src/app/shared/dialogs/change-password.directive.ts: dropped the redundantswitchMap(response => of(response))fromupdateAdminPassword(), returning thecouchService.put(...)observable with its existingcatchErrordirectly.Verification
npx ng test --watch=false— 54 files, 364 tests passing.npx ng lint planet-app— clean.teams.component.tstomasterfails the no-shelf case (expected 1 to be 2— the old fallback dropped the enterprise row).masterwas merged into this branch to resolve conflicts with itsquote-props/arrow-body-stylelint cleanups, which had touched the same lines; master's unquoted-property style is kept.🤖 Generated with Claude Code
https://claude.ai/code/session_01QNsUBGvzW85RHmcexWeDQk