Repository navigation
Let joiners see their own enrolment requests - #129
Merged
Merged
Conversation
33 tasks done
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.
Gives the app what it needs to show someone the state of their own enrolment request, and to tell an unknown token apart from a server that predates enrolment. Part of VoltiusApp/voltius#757 (the
voltius-cli enrolland "Sign in to " work).What changes:
resolve,redeemandregisternow answers 404 with{"error": "ENROLLMENT_NOT_FOUND"}. A bare 404 is left to mean "this server has no enrolment routes". Admin approve and deny keep their plain 404 for a request that is already gone.resolve,redeemand the registerenrollmentobject now includeteam_id, so the client matches teams by id rather than by name.approvestill returns the bare outcome.GET /v1/enrollment/requests(signed in): the caller's own requests, newest per team, pending or denied within the last 30 days, leaving out teams they already belong to. It sits outside the team-invites switch because it only reads the caller's own rows.my_join_requests_changed:{user_id}event whenever someone else changes their request: deny, approve (admitted, parked on the seat limit, or already a member), admission after email verification, and team deletion. Their own redeem stays silent. Released clients see an unknown event and run a plain sync.team_join_requests (user_id, team_id, created_at DESC)for that query. Rolling back to sha-e5af0d4 stays safe (the migrator ignores unknown versions and the old binary doesn't touch the index).Tests: full
cargo test925 passed,cargo clippy --all-targets -- -D warningsclean. New tests cover the coded 404 (and approve staying uncoded),team_idin every response, the request list (one row per team, 30-day window, member teams excluded, caller's rows only) and who gets notified when.Deploy before the client PR that consumes these routes merges.