INVITATION_WITHHELD is an empty-string sentinel that any host callback can return by accident
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
Start with server/orcaster_server/auth/config.py and server/orcaster_server/auth/router.py to trace the sentinel type and callback behavior. Update the seam contract in server/orcaster_server/workspaces/seam.py, its tests in server/tests/test_workspaces_seam.py, and add router level coverage for empty strings, None, and the sentinel. Run the relevant tests; done means the acceptance criteria pass and an Unreleased changelog entry is added.
Written by the indexing model from the issue text.
Description
Problem
The host callback AuthConfig.describe_invitation can ask the accept page to reveal nothing. It does so with INVITATION_WITHHELD = "" (server/orcaster_server/auth/config.py:39-40), and the router compares it with == (server/orcaster_server/auth/router.py:228). The callback type is still Awaitable[str | None] (config.py:79).
So an empty string means "withhold" only by convention. return "" type-checks, and a reader cannot tell the intent. The contract says None means "nothing to describe, fall back to the label". If a host builds the description from parts and both are empty, for example f"{prefix}{name}", the callback returns "" and the page silently hides the target line, the label and the account note, with no log line.
Today the only host callback (server/orcaster_server/workspaces/seam.py:38-73) never returns "" by accident, so this is a latent risk, not a live bug.
Tests: the seam tests compare with == and assert INVITATION_WITHHELD == "" (server/tests/test_workspaces_seam.py:295, :313-314). No router-level test passes a stub callback that returns "".
Proposed change
Make the sentinel an object that no string can equal, and widen the callback type so the type checker sees it.
- Define a small class (for example
_Withheld) andINVITATION_WITHHELD: Final = _Withheld()inconfig.py. - Type the callback as
Awaitable[str | _Withheld | None]. - Compare with
isin the router. An empty string then falls back to the stored label like any other falsy description.
Alternative: return a small result type (for example text plus a withheld flag). More explicit, but it changes the callback contract for every host.
Acceptance criteria
-
INVITATION_WITHHELDis not equal to anystr, including"", and the router compares by identity or type. - The type of
AuthConfig.describe_invitationnames the sentinel type. - A router-level test with a stub callback:
""falls back to the stored label;Nonefalls back to the label; the sentinel withholds (neutral line, no label, no description). - The seam test asserts identity with the sentinel for a disabled workspace and a string for an enabled one; the old
== ""assertion is removed. - The comment in
config.pyand the docstring inseam.pydescribe the new contract. - Behavior of the built-in callback and existing page tests for expired and disabled workspaces is unchanged; existing deployments keep working without config changes.
- CHANGELOG entry under Unreleased.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
daniel-ospina/tortoise#15308 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
difficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#2405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Jstar269/nakagawa-recomp#3746 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day