Repository navigation
fix(resolve): handle members with null email in resolve_user_async - #37
Open
eb-terry-tyz wants to merge 1 commit into
Open
eb-terry-tyz wants to merge 1 commit into
eb-terry-tyz wants to merge 1 commit into
Conversation
Plane returns `email: None` for SSO-provisioned members. `m.get("email", "")`
does not protect against this because the key exists with a null value, so
`.lower()` raised AttributeError and any `--assignee <name>` lookup failed as
soon as such a member was present in the workspace.
Guard the value itself (matching the existing sync `resolve_user` logic) and
skip empty emails so an empty query cannot accidentally match a member that
has no email. Adds regression tests for fuzzy name lookup, case-insensitive
exact email match, and the empty-query case.
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.
Problem
planecli wi ls --assignee <name>fails on workspaces that contain membersprovisioned via SSO. Plane returns those members with
email: None(the key ispresent, the value is null), and the async resolver does:
The
""default only covers a missing key, so.lower()is called onNoneand raises
AttributeError. Because the loop iterates over all members beforethe name-based fallback runs, a single such member breaks every name/UUID
lookup, not just lookups for that user. This made
--assigneeunusable for usuntil we worked around it by listing all work items and filtering by user id.
Fix
Guard the value rather than the key, matching what the synchronous
resolve_useralready does at line 224:The
email andguard (rather than(m.get("email") or "")) also prevents anempty query from matching the first member that has no email.
Tests
Added
TestResolveUserAsyncNullEmailintests/test_resolve.pywith threecases against a member list containing
email: Noneentries:display_namelookup still resolves the right memberVerification
Ran the same checks as CI (
uv sync --locked && make check) on top ofba300d4/ v0.6.0:ruff check src/ tests/— passedruff format --check src/ tests/— 43 files already formattedpytest tests/— 245 passedAlso confirmed against a live Plane instance that
planecli wi ls -p SOLOCO --assignee 黄晨旭now returns the expected 5 workitems, and that
--assignee meand unknown-name handling are unchanged.