Skip to content

Patrol updates - #1745

Merged
luixlive merged 5 commits into
developfrom
patrol-updates
Oct 1, 2026
Merged

luixlive merged 5 commits into
developfrom
patrol-updates

Conversation

@luixlive

@luixlive luixlive commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Final tweaks to the patrols flow, plus dependency upgrades.

Patrols

  • Reads the universal and patrol type schemas as a bare {json, ui}. Both endpoints now return that shape since das PR #4257, and the {data, status} fallback is removed. Failed schema requests are now logged with console.warn.
  • Stops adding the team lead to the team members when building a leg. The server no longer requires the lead to be a member, and it rejects members who are not on the configured roster, so adding the lead could cause a 400.
  • Takes the Team Lead options, in the leg form and in the Patrols Feed filter, from the patrol configuration's team members instead of the trackedby leaders list.

Dependencies

  • @rjsf/* 6.10.1 → 6.11.0 and mapbox-gl 3.31.0 → 3.32.0.
  • msw 2.15.0 → 3.0.0: tests import http and HttpResponse from msw/http, and the Jest import.meta transformer now rewrites import.meta.url.
  • useReportsFeed now catches a failed event feed request and logs it, ignoring cancelled requests, instead of leaving the rejection unhandled.

Evidence

  • yarn test src/SideBar/PatrolsManager src/ducks/patrol-schemas src/utils/patrols: 52 suites, 1226 tests passing.
  • ESLint is clean on the touched files.

Relevant link(s)

Notes

  • Deploy order: this needs das PR #4257 (ERA-14076). Against an older backend, the segment type schema still comes back wrapped and the leg forms break, so the two must ship together.
  • Team Lead options now depend on the configured member roster. A site with no member groups configured gets an empty Team Lead select and filter. A saved tracked_by who is not on the roster shows as "Unknown team lead".
  • The trackedby leaders request still runs on every load, but only the legacy patrol UI reads it now. It can be removed together with that UI.

- Upgraded @rjsf/core, @rjsf/react-bootstrap, @rjsf/utils, and @rjsf/validator-ajv8 to version 6.11.0 for improved functionality and compatibility.
- Updated mapbox-gl to version 3.32.0 to leverage the latest features and fixes.
- Updated `msw` from version 2.15.0 to 3.0.0 to leverage new features and improvements.
- Adjusted import paths for `http` and `HttpResponse` from `msw` to `msw/http` across multiple test files for consistency.
- Enhanced Jest configuration to support new import.meta transformations and added global timer functions for improved testing capabilities.
claude[bot]

This comment was marked as spam.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Feed failure handling lacks regression coverage, and the documented MSW import remains outdated.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
What changed in this PR

Aligns patrol forms with updated backend schema and roster contracts while upgrading dependencies and improving request error handling.

Changes:

  • Uses bare patrol schemas and roster members for team-lead options.
  • Stops automatically adding patrol leaders as members.
  • Upgrades RJSF, Mapbox GL, and MSW; handles event-feed failures.
File Description
package.json Upgrades dependencies and Jest transforms.
yarn.lock Resolves upgraded dependencies.
jest-config/​transformers/​transformImportMetaEnv.js Transforms import.meta.url for Jest.
src/​setupTests.js Adds immediate timer globals.
src/​utils/​patrols.js Preserves leg membership when continuing patrols.
src/​utils/​patrols.test.js Updates continuation and roster tests.
src/​utils/​parallelPaginatedRequest.test.js Migrates MSW imports.
src/​utils/​events.test.js Migrates MSW imports.
src/​TimepointPopup/​index.test.js Migrates MSW imports.
src/​SideBar/​useReportsFeed/​index.js Handles feed request rejections.
src/​SideBar/​useReportsFeed/​index.test.js Migrates MSW imports.
src/​SideBar/​useFetchPatrolsFeed/​index.test.js Migrates MSW imports.
src/​SideBar/​PatrolsManager/​utils/​buildLegDraft/​index.test.js Updates roster fixtures.
src/​SideBar/​PatrolsManager/​PatrolsFeed/​index.test.js Updates member-based state fixture.
src/​SideBar/​PatrolsManager/​PatrolsFeed/​Filters/​index.test.js Updates filter state fixture.
src/​SideBar/​PatrolsManager/​PatrolsFeed/​Filters/​FiltersPopover/​index.js Uses members for lead filters.
src/​SideBar/​PatrolsManager/​PatrolsFeed/​Filters/​FiltersPopover/​index.test.js Tests member-based lead filtering.
src/​SideBar/​PatrolsManager/​PatrolOverview/​index.test.js Waits for asynchronous modal closure.
src/​SideBar/​PatrolsManager/​NewPatrol/​index.test.js Updates roster fixture.
src/​SideBar/​PatrolsManager/​LegManager/​NewLeg/​utils/​buildNewLegDraft/​index.test.js Updates roster fixture.
src/​SideBar/​PatrolsManager/​LegManager/​NewLeg/​index.test.js Removes legacy leader fixture.
src/​SideBar/​PatrolsManager/​LegManager/​index.test.js Updates tracking state fixture.
src/​SideBar/​PatrolsManager/​LegManager/​EditLeg/​index.test.js Removes legacy leader fixture.
src/​SideBar/​PatrolsManager/​LegForm/​utils/​buildLegSegment/​index.js Keeps leaders separate from members.
src/​SideBar/​PatrolsManager/​LegForm/​utils/​buildLegSegment/​index.test.js Tests separate leader membership.
src/​SideBar/​PatrolsManager/​LegForm/​StaticFields/​index.js Sources leads from members.
src/​SideBar/​PatrolsManager/​LegForm/​StaticFields/​index.test.js Tests member-based lead options.
src/​SideBar/​PatrolsManager/​LegForm/​index.test.js Updates roster fixture.
src/​SideBar/​PatrolsManager/​Activity/​SummaryStats/​index.test.js Removes redundant leader fixture.
src/​SideBar/​index.test.js Migrates MSW imports.
src/​SideBar/​EventsManager/​EventOverview/​ReportDetailView/​index.test.js Migrates MSW imports.
src/​SideBar/​EventsManager/​EventOverview/​LinksSection/​LinkItem/​index.test.js Migrates MSW imports.
src/​SideBar/​EventsManager/​EventOverview/​index.test.js Migrates MSW imports.
src/​ReportFormSummary/​index.test.js Migrates MSW imports.
src/​PatrolDetailView/​index.test.js Migrates MSW imports.
src/​NotificationMenu/​index.test.js Migrates MSW imports.
src/​Nav/​index.test.js Migrates MSW and stabilizes request timing.
src/​ducks/​user-content/​index.test.js Migrates MSW imports.
src/​ducks/​system-status.test.js Migrates MSW imports.
src/​ducks/​patrols/​index.test.js Migrates MSW imports.
src/​ducks/​patrol-schemas/​index.js Reads bare schemas and logs failures.
src/​ducks/​patrol-schemas/​index.test.js Tests bare schemas and warnings.
src/​ducks/​messaging.test.js Migrates MSW imports.
src/​ducks/​events.test.js Migrates MSW imports.
src/​ducks/​event-types/​index.test.js Migrates MSW imports.
src/​ducks/​event-schemas/​index.test.js Migrates MSW imports.
src/​ducks/​event-categories/​index.test.js Migrates MSW imports.
src/​ducks/​community.test.js Migrates MSW imports.
src/​ducks/​analyzers.test.js Migrates MSW imports.
src/​DetailViewComponents/​ActivitySection/​index.test.js Migrates MSW imports.
src/​DetailViewComponents/​ActivitySection/​ContainedReportListItem/​index.test.js Migrates MSW imports.
src/​AddToPatrolModal/​AddToPatrolModal.test.js Migrates MSW imports.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json Outdated
Comment thread src/SideBar/useReportsFeed/index.js
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chrisj-er chrisj-er left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking or important issues found

Base automatically changed from ERA-14102 to develop October 1, 2026 22:52
@luixlive
luixlive merged commit bcfd99f into develop Oct 1, 2026
8 checks passed
@luixlive
luixlive deleted the patrol-updates branch October 1, 2026 22:52
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