Repository navigation
chore(regions): remove region-level event defaults feature - #538
Merged
Merged
Conversation
The `eventDefaults` group (language + timeZone) on Regions and its `eventDefaultsFallback` afterRead inheritance hook were unconsumed — nothing in this app or the Atlas client read the inherited values, yet the per-read ancestor query fired on every region read (and, on the feat/regions-events-webpath branch, forwarded the client `req` without a `select`, 400-ing client reads that populated a region). Remove the field group + admin UI, the afterRead hook, the seed importer's `buildEventDefaults` wiring (+ orphaned legacy `defaultLanguageCode`), the now-unused `getTimezoneOptions` helper, and the associated tests. `SUPPORTED_TIMEZONES` stays (the schedule field's `timezone: true` companions use it); its unit test is repointed there. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Drops the schema objects the removed Regions `eventDefaults` group created: the `regions.event_defaults_language` column + its enum, and the `regions_event_defaults_time_zone` table (+ FK/indexes) + its enum. Reversible `down()` recreates them. Pairs with the field/hook removal in the preceding commit. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-538 environment in sahajcloud
|
…olver The `RESOLVING_FLAG` re-entrancy guard existed solely to stop the removed `eventDefaultsFallback` afterRead hook — whose selectless nested `regions` read returned full docs and re-triggered the webPath field hooks — from making the resolver re-scan the tree per ancestor. With that hook gone, the resolver is protected by its own narrow `select` (slug + breadcrumbs only, so webPath/webUrl field hooks never run on its results) plus the identity-keyed per-request memo. Remove the flag, the context clone, and the short-circuit; #537's webPath integration tests still pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Ardnived
force-pushed
the
chore/remove-region-event-defaults
branch
from
July 5, 2026 13:59
3f9ceaa to
87899ee
Compare
This branch was successfully 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.
Summary
eventDefaultsgroup on Regions + its ancestor-inheritance hook), which nothing consumed.eventDefaultsFallbackafterRead hook ran an extraregionsquery on every region read, and forwarded the clientreqwithout aselect— 400-ing client reads that populated a region (e.g.GET /api/events?select[region]=true&depth=1, or the geojson feed).Changes
src/collections/Regions/Regions.ts— drop theeventDefaultsfield group + theeventDefaultsFallbackafterRead registration (Events tab keeps itseventsjoin).src/collections/Regions/hooks/eventDefaultsFallback.ts— deleted.src/lib/atlas/regionWebPaths.ts— remove the now-deadRESOLVING_FLAGre-entrancy guard. It existed only to stopeventDefaultsFallback's selectless nested read from re-entering the webpath resolver; with that hook gone, the resolver's narrowselect(slug + breadcrumbs) plus the per-request memo are sufficient. (This resolver arrived onmainvia feat(regions,events): server-computed webPath/webUrl + webPath in geojson feed #537 after this branch was cut — see Notes.)seeds/atlas/import.ts— removebuildEventDefaults+ its wiring;upsertRegionloses its now-unusedlanguageCodeparam (and the legacydefaultLanguageCodeit fed).timeZoneis untouched — it still seeds each event's schedule timezone.src/lib/timezones/index.ts— remove the orphanedgetTimezoneOptionswrapper;SUPPORTED_TIMEZONESstays (the schedule field'stimezone: truecompanions use it). Its unit test is repointed toSUPPORTED_TIMEZONES.src/payload-types.ts— regenerated (drops the eventDefaults language/timezone unions; keeps feat(regions,events): server-computed webPath/webUrl + webPath in geojson feed #537's webPath/webUrl).atlas-collections.int.spec.ts; refresh stale comments inlanguageOptions.tsandseeds/atlas/MIGRATION_PLAN.md.Migration
src/migrations/20260705_134239_drop_region_event_defaults.tsregions.event_defaults_language(+ enum) and theregions_event_defaults_time_zonetable (+ FK/indexes/enum). The stored eventDefaults values are dropped (intended — the feature is being removed).down()recreates the column, table, enums, FK, and indexes.Test Results
regions+events-geojson+atlas-collections+event-verification— 44 passed (of 44); the webPath specs (from feat(regions,events): server-computed webPath/webUrl + webPath in geojson feed #537) confirm the resolver still behaves correctly withoutRESOLVING_FLAG.SUPPORTED_TIMEZONEStest.Manual verification
depth ≥ 1(or populateevent.region): returns 200 — no more selectless internalregionsquery.Notes for reviewer
feat(regions,events): server-computed webPath/webUrl), which merged after this branch was cut. That PR introducedregionWebPaths.tswith theRESOLVING_FLAGguard whose sole purpose was coordinating with the (now-removed)eventDefaultsFallbackhook — feat(regions,events): server-computed webPath/webUrl + webPath in geojson feed #537's own comment ineventDefaultsFallback.tsdocumented the coupling. Removing that guard here completes the removal; feat(regions,events): server-computed webPath/webUrl + webPath in geojson feed #537's webPath integration tests pass against it.seeds/atlas/extract.tsstill emits the legacydefault_language_codecolumn into the intermediateregions.json. Left intentionally — the extractor mirrors source columns;import.tssimply no longer maps it.🤖 Generated with Claude Code