Skip to content

Conversation

thomasleese
Copy link
Contributor

No description provided.

thomasleese and others added 30 commits September 17, 2025 12:02
This fixes an issue where some vaccination records are currently invalid
as they have both a `location_id` and a `location_name`.

Jira-Issue: MAV-2016
Add `data_migrations:fix_vaccination_records_location`
These have all been run in our deployed environments so we can safely
remove the migrations.
This renames the `PatientSession` model to `PatientLocation` in
preparation for the next commit which will restructure the model to
remove the association to the session and instead link to a location and
an academic year.

Jira-Issue: MAV-1822
This reworks the `PatientLocation` model to no longer have a direct
association with a session and instead have a separate `location_id` and
`academic_year`, which represents the equivelant information since
that's all that is needed to get the sessions for the patient.

Jira-Issue: MAV-1822
This simplifies the lookups for patients and sessions by removing the
duplicate scopes between patient locations and patients, instead using
the scopes on the patient only, and making sure to filter out patients
who shouldn't belong in the session before we need to query for this.

Jira-Issue: MAV-1822
- Prevent frequently querying database for infrequently changing results
Introduce a rails cache for web server
…less_redis

Add serverless elasticache deployment permissions
- Was only endpoint address but lacking protocol
This will be used to configure Rails caching using Redis.

Jira-Issue: MAV-2006
This enables the use of Redis as a backend for the Rails cache, allowing
for the cache to be distributed across the various web instances.

Jira-Issue: MAV-2006
This adds a service class which is responsible for displaying counts in
the headers and navigation bar. At the moment, this just refactors the
existing code to use this class, but it allows us in the future to cache
these values and improve performance.

Jira-Issue: MAV-2006
This updates `TeamCachedCounts` to cache the values in the header to
ensure a more performant page load instead of needing to query the
latest information from the database each time.

Jira-Issue: MAV-2006
- For invalidating caches

JIRA Ticket: MAV-2006
This should have an improvement on performance, avoiding the need to
compare the entire result set. Due to the size of the set, it's unlikely
to be able to use a hash and instead performs a sequential scan.

Jira-Issue: MAV-2004
This makes a number of small improvements to the queries to improve
performance and fix an issue with the session counts.
Bumps [solargraph-rails](https://github.com/iftheshoefritz/solargraph-rails) from 1.2.3 to 1.2.4.
- [Changelog](https://github.com/iftheshoefritz/solargraph-rails/blob/main/CHANGELOG.md)
- [Commits](iftheshoefritz/solargraph-rails@v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: solargraph-rails
  dependency-version: 1.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.25.9 to 0.25.10.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.25.9...v0.25.10)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.25.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aws-sdk-ec2](https://github.com/aws/aws-sdk-ruby) from 1.556.0 to 1.557.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-ec2/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-ec2
  dependency-version: 1.557.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…h-rails-1.2.4

Bump solargraph-rails from 1.2.3 to 1.2.4
…c2-1.557.0

Bump aws-sdk-ec2 from 1.556.0 to 1.557.0
thomasleese and others added 18 commits September 17, 2025 22:38
…ild-0.25.10

Bump esbuild from 0.25.9 to 0.25.10
Bumps [solargraph](https://github.com/castwide/solargraph) from 0.56.2 to 0.57.0.
- [Changelog](https://github.com/castwide/solargraph/blob/master/CHANGELOG.md)
- [Commits](castwide/solargraph@v0.56.2...v0.57.0)

---
updated-dependencies:
- dependency-name: solargraph
  dependency-version: 0.57.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…h-0.57.0

Bump solargraph from 0.56.2 to 0.57.0
This improves the performance of the patient lookup by using an `EXISTS`
to reduce the size of the result set allowing the database to avoid a
sequential scan.

Jira-Issue: MAV-2004
Fix performance degradation in patients query
This fixes a number of places where the cache for the counts in the
header weren't being invalidated meaning they would end up with the
incorrect value.

Jira-Issue: MAV-2004
Ensure cache invalidation happens
This reverts commit b75ebdf.
The factory no longer exists but these variables weren't being
referenced anywhere in the test so it wasn't failing. I've fixed the
test and updated the reference to the right factory.
This ensures that when we re-enable caching, we'll already have
regression tests in place.

Jira-Issue: MAV-2006
Revert caching of navigation bar counts
This improves test coverage for the invite to clinic feature by ensuring
we can handle adding patients to clinic that are already in the clinic,
and also covering the scenario where a patient exists in the clinic
already and have received an invitation.

This covers a bug that currently exists in production:
https://good-machine.sentry.io/issues/6885411856/
Import test coverage for invite to clinic
Copy link

@thomasleese thomasleese merged commit 988162c into main Sep 18, 2025
45 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants