Repository navigation
Conversation
… request The Join session menu and the New session dialog asked /nearest once per relationship. Send coaching_relationship_ids instead, splitting into groups of 50, and send the single-person read as a one-id list so nothing uses the old coaching_relationship_id param. Contract: coaching_sessions_nearest_window v4.
This branch has not been deployed
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.
Description
The Join session menu and the New session dialog asked
/nearestonce per person a coach works with, so a coach with 20 people sent 20 requests each time either one loaded. They now send one request per 50 people, using the batched form of/nearestagreed with the backend: contractcoaching_sessions_nearest_windowv4 (decisioncoaching_sessions_nearest_window_v4_agreed, backend rs#466).GitHub Issue: none (follow-up from #527)
Changes
/nearestrequests:NearestWindow.relationshipIdbecomesrelationshipIds, sent ascoaching_relationship_ids(comma-separated). Nothing sends the old singlecoaching_relationship_idany more, so the backend can retire it.useNearestEachCoachingSessions: splits the ids into groups of 50 (NEAREST_MAX_RELATIONSHIPS), sends one request per group with one session either side of now, and merges the results. If any group fails, the whole read fails. With no relationships, no request is sent.coaching-sessions-nearest-batched.test.tsx, covers:Testing Strategy
npx vitest run,npx tsc --noEmit./nearestrequest carrying every relationship id, and show the same people and sessions as before.before=2&after=3.Live verification (against rs#466's branch, local Postgres)
/nearestrequest carrying all 9 relationship ids, sent only once the menu opens. The carousel order, inactive count and "Last …" labels match the DB. The menu also passes design-system test plan cases G2, G3, G6 (all three windows), G7, G10, G14 and G15./nearestreturning 500, it falls back to name order as before.aroundcounts as after;include=relationship;Concerns
mainbackend,/nearestrejects requests that don't havecoaching_relationship_id.