Repository navigation
Conversation
…e page loaded The Start Session form computed the current date once, at module scope, and used it as the in-person session date, the upper bound for a retrospective date and the reference for the group's minimum age. Every session started later in the same page load was backdated to when the page first opened. Each check now reads the clock when the form is validated, and the in-person default is built at submission. Closes DouglasNeuroInformatics#1675 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retrospective session's date is now a date and time, so the time of collection is kept (for MouseODC, the time of day is a proxy for hormonal variation). The date is required: a blank one used to be read as the moment the form was submitted, and a time typed without a date was lost. Closes DouglasNeuroInformatics#1029 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… time of day The export projected each row's timestamp from the day the record was inserted, so a retrospective session, a bulk upload or a remote assignment exported with the wrong date, and every row lost its time. It now takes the record's own date, and both it and the session date keep their full ISO timestamp. Closes DouglasNeuroInformatics#1717 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A group manager can choose one form instrument as the group's Session Instrument. Start Session then shows that form after the session details, with a Back control, and the session is created only once the form is submitted: POST /v1/sessions carries the answers and creates the session and a record of them, dated as the session is, or neither. If the record fails to save, the session is deleted, and so is the subject if this request created it. The server refuses a session in such a group without the answers, and answers for a group that requires none. The setting follows a new edition of the form once that edition is saved, an update that would take the form away from the group is refused, and a group is never created with one. The gateway synchronizer, CSV upload and demo seeding create sessions in process and are not asked for it. The group's manage page now reads the group fresh rather than as it was at sign-in, since a save sends back every setting it was seeded with and so could undo a change made since. Refs DouglasNeuroInformatics#1546 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A group manager can now make one form part of starting a session. Start Session shows the form after the session details, and the session and the form's record are created together or not at all. Three fixes to session timestamps come with it. This is the first of two PRs for #1546.
Closes #1675. Closes #1029. Closes #1717.
Changes
GET /v1/groups/:id, which its loader fetches, and a save writes its response back to that query.POST /v1/sessionsmoves to a newStartSessionModule(OpenAPI tagStartSession) and accepts an optionalsessionInstrumentAnswers: { data, instrumentId }. Its refusals:create InstrumentRecord.YYYY-MM-DD(Datahub export timestamp is the day the record was inserted, not when it was collected #1717).Decisions
SummaryModuledoes.SessionsServicecannot injectInstrumentRecordsServicewithout a cycle, and this avoids aforwardRef. libnest tags an operation by its controller's class, soPOST /v1/sessionsnow sits underStartSessionin/spec.json, apart fromGET /v1/sessions.SessionsService.createstill takes$CreateSessionData. The gateway synchronizer, CSV upload and demo seeding create sessions in process, so they cannot pass a record and are not asked for one.delete Session, and the ids are rows this request just created.SessionsService.createManyrolls back the same way. Whether the subject is new is checked with an unscopedSubjectsService.exists, since a scoped lookup would miss a subject in another group and the rollback would then delete it.GET /v1/groups/:idthat its loader prefetches. The store'scurrentGroupcomes from the login token, so it would miss a setting changed since sign-in.Risks
/v1/sessionsfor a group with a session instrument gets 422 until it sends the answers. In this repo, only the web app calls the route.dateorsession.datecolumns asYYYY-MM-DDwill now see ISO timestamps.00:00:00is both the default time of a retrospective date and a real time, so a retrospective session cannot record "time unknown". This was Retrospective sessions should allow DateTime entry #1029's open question, and it is still open.date = createdAtscript would be wrong on demo instances.Adversarial review
Reviewed at commit d5d749d. pnpm check: green.
Findings
sessionInstrumentRecordnamed the request's result, but the field carries the form's answers — Rename it.POST /v1/sessionsis tagged "StartSession" in/spec.json, apart fromGET /v1/sessionsunder "Sessions" — Keep both routes under one tag.StartSessionFormDatadeclaredsessionDaterequired while its schema makes it optional — Declare it optional.Fixed
SubjectsService.existsfound none before the session was created.GET /v1/groups/:id, fetched by its loader, and a save writes its response back to that query.sessionInstrumentAnswers.Declined
ApiOperationmetadata (docs.generator.js:87), so the tag can only follow the class. The handler moved to its own controller to break theSessionsModule/InstrumentRecordsModulecycle, and naming that classSessionsControllerwould give the app two controllers of one name. The path is still listed once in/spec.json.Attestation
I, Claude Opus 5.5, attest that the review block above reports the adversarial review as it ran on the commit named, with every finding it returned.
🤖 Generated with Claude Code