Repository navigation
feat(shared): generate the Occurrences of a recurring Series - #208
Merged
Merged
Conversation
Part 1 of the recurring Events spec: the pure generator every later part (storage, routes, the daily timer, the UI) builds on. No storage, routes or UI change here. OccurrenceGenerator.Generate(series, now, existing, skipped) returns, in order, the instants of the Occurrences to create now: every rule date from the later of the first instant and now up to and including now plus 8 weeks, and always the first rule date after now even when it is further out. Existing and skipped (cancelled) instants are never returned; a skipped date does not count as the next one. Keys compare as instants. Rules: weekly, every other week, monthly on the nth weekday (First to Fourth, or Last), monthly on the same date (clamped to a short month's last day), yearly on the same date (29 February falls on the 28th outside leap years), and yearly on a holiday preset from an in-house table (Easter by the anonymous Gregorian algorithm, the US floating holidays, and the fixed dates). Calendar arithmetic runs at the first instant's UTC offset with no time zone database, so the UTC time of day never moves across daylight saving (accepted drift, #206). RecurrenceRule.Validate() names an invalid rule and the generator refuses one with ArgumentException. ADR 0002 records the Series and Occurrence model from the 0.6.0 grilling. Refs #100, #204
Summary
🎉 No failed tests in this run. Github Test Reporter by CTRF 💚 |
This was referenced Nov 22, 2026
mwg-bender Bot
added a commit
that referenced
this pull request
Nov 23, 2026
) > *This was generated by AI (Nerd Bender's Kanban worker, card t_711ba11a).* ## Summary Closes the follow-ups of #196 (shared Library page and its pages) under spec #205, and removes `GameService`. The Events page, the Stats page and the Activity details performance panel now read the Games through `LibraryClient<GameEntity>`. Library form errors now reach the inner input of a Fluent text field in a real browser. The rest is the review's test and design leftovers. One commit, `refactor(web)`, `Refs #196, #205`. ## Change - **#196.1 GameService removed.** `Events.razor`, `Stats.razor` and `ActivityPerformancePanel.razor` inject `LibraryClient<GameEntity>` and call its `GetAllAsync`, which throws on failure the same way, so each page keeps its error bar and Retry. `GameService.cs`, its registration and its `PageHarness` entry are gone, as are the duplicate `GET api/games` route row and the `typeof(GameService)` entry. `ApiResultTests` keeps its point (a real service load against a failing server yields the server's message) with `EventService`. New `GameReadersTests`: Events, Stats and the panel each send exactly one `GET api/games`. - **#196.2 Messages reach the input.** A Fluent text field copies `aria-describedby` into its shadow root, where the message id does not resolve. `LibraryFieldMessage` now loads a collocated module (`LibraryFieldMessage.razor.js`) that sets `input.ariaDescribedByElements = [message holder]` on the field's inner input. That is ARIA element reflection, which crosses the shadow boundary. Chromium then gives the field its message as its description, and the description follows the message as it comes and goes. The Game picker (`fluent-select`) is the combobox itself, so its own `aria-describedby` already resolves; the module leaves it alone. bUnit checks: the link call per field names the holder that the field's `aria-describedby` names, and the Game picker's `aria-invalid` and `aria-describedby`. Browser evidence is below. The Events card solves the metrics form separately. - **#196.3** `LibraryName<T>.Of` reads a null name as empty, so a search never throws on it. - **#196.4** `Program.cs` registers everything through `AppServices.AddAppServices(apiBase)`. A test builds that and resolves the four Library clients and the app's `HttpClient`. - **#196.11** One `LibraryItemButton` for the Edit and Delete of table rows, the icon card and the Games card (`Labelled`). `Activities.razor` gets one `DetailsKey(id)` for the `details-{id}` focus key. - **#196.12** `LibraryName<T>` replaces the `Name` + `SetName` pair. `LibraryField` is the one typed key for `LibraryFieldError.Field`, `LibraryFieldMessage Field=` and `FieldAttributes(...)`, and it owns `MessageId`. - **#196.13** `RowAction` says `AnyBusy`. `Running` stays only as an alias for `Shared/Events/EventList.razor`, which this card may not edit. `AddLibraryClients` moves to `LibraryClients.cs`. `LibraryPage` implements `IDisposable` and unsubscribes `OnValidationStateChanged` when the editor closes or the page goes. - **Tests (#196.5, .6, .8, .9, .10).** - `LibraryPageTests` (823 lines) is split over one abstract `LibraryPageFixture` into `LibraryPageTests` (list), `LibraryEditorTests`, `GamesWebsiteTests` and `LibraryClientTests`. Every base test exists exactly once. - The stale toggle test is renamed and renders Activities with rows. - `GetRawConstantValue` is replaced by direct `AreEqual` on the constants. - `LibraryClientTests` and `ServiceRouteContractTests` share one disposed provider setup (`LibraryServices`). - `ActivitiesPageTests` asserts the editor's own "Game is required." and no longer hard-codes the API text. - `ThemesHolidaysPageTests` uses `using`s and puts the title and icon type in the `DataRow`. - `LibraryPage.razor` is 384 → 379 lines. ## Validation Base `origin/dev` moved during the run, from 2730911 to 617f4a4 (#207 docs, #208 Series, no file in this card's scope). The branch was rebased before push and everything below was re-run on the rebased head. | | errors | warnings | Api.Tests | Web.Tests | |---|---|---|---|---| | base 2730911 (cold, worker) | 0 | 0 | 495 + 4 skipped | 727 | | base 617f4a4 (cold, worker) | 0 | 0 | 589 + 4 skipped | 727 | | head (rebased, cold, worker) | 0 | 0 | 589 + 4 skipped | **735** (727 + 8) | Count preservation: no test removed. One renamed (`CardView_IsOfferedOnlyToAPageThatGivesACardTemplate` → `ViewToggle_IsOfferedOnlyToAPageWithACardTemplateOrIcon`). Eight added: - `GameReadersTests.EventsPage_SendsOneGamesRead` - `GameReadersTests.StatsPage_SendsOneGamesRead` - `GameReadersTests.ActivityDetails_PerformancePanel_SendsOneGamesRead` - `LibraryPageTests.Search_AnItemWithNoName_CountsAsEmpty` - `LibraryClientTests.AppServices_RegisterTheFourLibraryClients` - `LibraryEditorTests.Editor_AClosedEditorsForm_NoLongerRendersThePage` - `LibraryEditorTests.FieldMessage_LinksItsMessagesToTheFieldsInput` - `ActivitiesPageTests.GamePicker_SaysItIsInvalid_AndNamesItsMessage` A name diff of base against head shows no other change. Break-it mutations, each applied to a throwaway copy of the production line and restored. All 10 went red: - M1: null name not defaulted - M2: no unsubscribe - M3: `AddLibraryClients` removed from `AppServices` - M4: no link call - M5: Game picker without `FieldAttributes` - M6: Events reads Games twice - M7: Stats with no Games read - M8: panel with no Games read - M9: Activities rows hidden - M10: shared Edit button never disabled Live runs by the worker, through `with-slot.sh` (Azurite + API + Release web build behind SWA, headless Chromium 153, admin cookie), on the branch and on plain `origin/dev` 617f4a4 as a control: | flow | branch 17270c8 | control `origin/dev` 617f4a4 | |---|---|---| | G1a Events page: one `GET api/games`, the Event's Game shows | PASS (x1, shown) | PASS (x1, shown) | | G1b Stats page: one `GET api/games`, Game named, not Deleted | PASS (x1, offered 1) | PASS (x1, offered 1) | | G1c Activity details: panel reads Games once, numbers show | PASS (page x1, panel x1, offered 1, won 1) | PASS (same) | | G2 Games editor: invalid fields described by their messages | **PASS** | FAIL (descriptions `""`) | | G2 Activities editor | **PASS** | FAIL (Activity Name `""`; the Game combobox already PASSES on dev) | | G2 Themes editor | **PASS** | FAIL (`""`) | | G2 Holidays editor | **PASS** | FAIL (`""`) | | G3 Games: invalid Website message linked, follows fix and break; nothing stored | **PASS** | FAIL (`""` throughout; nothing stored on either) | | G4 repo E2E suite | 7 of 7 | 7 of 7 | G1 is the same on both sides, so the Game reads did not change. G2 and G3 fail on `dev` and pass on the branch, which is the #196.2 fix. Accessibility-tree output from the branch, verbatim (Chromium CDP `Accessibility.getFullAXTree`): ``` G2 Games editor: [{"role":"textbox","name":"Game Name","description":"Name is required.","invalid":"true"},{"role":"textbox","name":"Website (Optional)","description":"Website must be an http or https address.","invalid":"true"}] G2 Activities editor: [{"role":"combobox","name":"Game","description":"Game is required.","invalid":"true"},{"role":"textbox","name":"Activity Name","description":"Name is required.","invalid":"true"}] G2 Themes editor: [{"role":"textbox","name":"Name","description":"Name is required.","invalid":"true"}] G2 Holidays editor: [{"role":"textbox","name":"Name","description":"Name is required.","invalid":"true"}] G3 broken={"description":"Website must be an http or https address.","invalid":"true"} fixed={"description":"","invalid":"false"} again={"description":"Website must be an http or https address.","invalid":"true"} ``` The same on `origin/dev`: `{"role":"textbox","name":"Game Name","description":"","invalid":"true"}` and the same empty description for every text field. Before the fix, a probe on the base compared the techniques: a host idref gave `""`; `input.ariaDescribedByElements` gave the message and followed it live; `aria-description` on the input gave the text but would need re-syncing; on the host it gave `""`; `ariaErrorMessageElements` gave only an errormessage relation, no description. The element link was chosen. ## Notes - `RowAction.Running` is kept as a one-line alias because `EventList.razor` (Events card) still reads it. That card or wave 2 can switch it to `AnyBusy` and delete the alias. - #196.7 is outside this card (Events card, `DialogSafetyTests`). #196.14 and #196.15 were declined in the card. - `Refs`, not `Closes`: Nerd closes #196 by hand once every item has a disposition.
mwg-bender Bot
added a commit
that referenced
this pull request
Nov 23, 2026
> *This PR was generated by AI (Nerd Bender, Kanban card t_e2cd66ba).* ## Summary This PR covers the Events-side follow-ups of the #190 review (#195), plus the Events-side items parked from #196 and #200. Spec: #205. One commit by `MWG Bender[bot]`, rebased on `dev` 617f4a4 (Docs #207 and Series #208 merged while this ran; neither touches these files). Two behaviour fixes, test-first. Everything else is tests, comments and file splits. ## Change **Behaviour** - **#195.5 Select Winner's Discard while a request runs.** Before: answering the question's Discard while a Comment add or a metrics save was running closed the question, saved nothing, and said nothing. Now the question stays open and its Discard button is disabled while the details dialog is `Busy`. The text is unchanged, and Keep editing stays usable. Once the request ends, Discard saves the new Winner. This uses one optional parameter on `ConfirmDialog`, `ConfirmDisabled` (default `false`, so every other question renders as before). Its answer guard ignores a confirm while the parameter is set. - **#195.6 Metrics field errors reach a screen reader.** In a real Chromium the host's `aria-describedby` is copied onto the shadow `<input>` but cannot resolve there, so the accessible description was empty (output below). While a message shows, it is now the field's `aria-label`, which the text field copies onto its input. Each message starts with the field's label. The unresolvable `aria-describedby` is gone. The message keeps `role="alert"`, so it is announced once when it appears and is part of the name when the field is focused. **Tests and comments** - #195.1: the `ConfirmRequest` and `EventDetailsDialog` comments now say what each Discard does. `OverDialog` describes only its own contract, and the two `Discard` overloads share one wording. - #195.2: `EventsPageWiringTests` now covers the edit dialog's `Themes`, `Holidays`, `PageError` and `ActionError`, and the details dialog's `ActionError`. Its fixture has 2 Themes and 1 Holiday. - #195.3: `SavingSelectionsAfterMetricsLeavesTheMetricsIntact` uses a stub whose Event PUT writes any metric the Event body carries into the stored metrics. It no longer pins `partitionKey`, `rowKey` or `timestamp`. `ASecondSaveWhileOneIsInFlightSendsNothing` runs Save's own handler past the disabled button. `DialogSafetyTests` uses the page's Select Winner handlers instead of the private `SelectWinner`. - #195.4: the rules test is a 19-row `DataRow` table with the limits written once as literals. It covers a leading `+` and unreadable text, and uses no reflection. - #195.8 / #200.9: new `PageActions.cs` (`Pick`, `RowButton`, `Card`, `Dismiss`, `ClickHandler(s)`, `Normalize`) and `StoredComment.cs` replace the copies in this card's files. `Labels`/`MetricNames` became one `Metric(Label, JsonName)` array, `var f = field;` is gone, and `EventMetricsRules` is `internal`. - #195.9: the three long files are split by behaviour, and every test still exists exactly once. `EventMetricsFormTests` 738 → 234 + `EventMetricsValidationTests` 168 + `EventMetricsGuardTests` 273 + fixture 132. `DialogSafetyTests` 707 → 354 + `DismissSafetyTests` 218 + fixture 170. `CommentsFromEventDetailsTests` 619 → 329 + `CommentsSelectWinnerTests` 183 + fixture 129. - #196.7: `CancelForm` and `_edit` are no longer reached by reflection (see the dispositions below). **Deviation from the card:** `MW-GC.EventManager.Web/Shared/ConfirmDialog.razor` was not in the edit list. Item 5's decision ("keep Discard disabled") needs a disabled state on the question's button, so Nerd added this one file for one optional parameter. No other 0.6.0 card lists it. ## Validation All numbers come from cold builds (`clean-build.sh`, then `build --no-incremental`, then `test --no-build`), measured by the worker. | | errors | warnings | Api.Tests | Web.Tests | |---|---|---|---|---| | base `dev` 617f4a4 | 0 | 0 | 589 passed + 4 skipped | 727 | | this branch 34c3bd4 | 0 | 0 | 589 passed + 4 skipped | **751** | The card's base (2730911) measured 0/0, Api 495+4, Web 727. The Api change comes from #208 on `dev`, not this PR. **Web count, 727 → 751:** 2 tests replaced and 26 added. Both replaced tests pinned behaviour this PR changes or removes: - `SelectWinner_DiscardAnsweredWhileACommentRequestRuns_SavesNoWinner` is replaced by `SelectWinner_DiscardWaitsWhileARequestRuns_ThenSavesTheWinner` ("comment add") and ("metrics save"). - The reflection-based `TheFormsRulesAreTheApis_ValueForValue` is replaced by 19 `DataRow`s. The 26 additions are those 21 cases, `ConfirmDialog_AConfirmThatMustWait_IsDisabledAndIgnored_ThenAnswersOnce`, and 4 wiring tests. Moved by the splits: 47 + 16 + 8 + 5 cases. A TRX diff shows no test case twice. **Test-first:** before the fix, the 3 new item-5 tests failed on `Assert.IsTrue(...Button("Discard").IsBusy())`. After it, all pass. **Break-it mutations.** Each was applied to a throwaway copy, run, and restored, and all 16 went red: - W1 `Events.razor:41` drop `Themes="_themes"` → `TheCreateDialogFiltersOfferTheLibrarysThemesAndHolidays` - W2 `Events.razor:41` drop `Holidays="_holidays"` → same test - W3 `Events.razor:42` drop `PageError="SetPageError"` → `TheNextSave_ClearsThePagesMessage` - W4 `Events.razor:42` drop the edit dialog's `ActionError="SetActionError"` → `AnEditSaveFailingAfterItsDialogClosed_ShowsInThePagesErrorBar` - W5 `Events.razor:42` swap it to `ActionError="SetPageError"` → same test - W6 `Events.razor:45` drop the details dialog's `ActionError="SetActionError"` → `ASelectWinnerFailingAfterItsDialogClosed_ShowsInThePagesErrorBar` - P1 `ConfirmDialog` `Answer` without the `ConfirmDisabled` guard → the 3 item-5 tests - P2 confirm button not disabled → the 3 item-5 tests - P3 `EventDetailsDialog` never sets `ConfirmDisabled` → 2 tests - P4 `EventMetricsForm` `aria-label` always the label → `EveryFieldMessageIsTiedToItsField` - P5 `Save` without `_saving` → `ASecondSaveWhileOneIsInFlightSendsNothing` - P6 `EventEntity` carries `Attendees` → `SavingSelectionsAfterMetricsLeavesTheMetricsIntact` - P7 Select Winner without `Busy` → `SelectWinner_DisablesAllWinnerButtonsWhileRunning_AndSendsOneRequest` - P8 `LibraryPage.CancelForm` without `_saving` → `CancelButton_IsIgnoredWhileSaveInFlight` - P9 `LibraryPage.Save` closes whatever is open → `SaveFinishingAfterCancelAndReopen_…` - P10 `EventEditDialog` save closes whatever is open → `EventsSaveFinishingAfterCancelAndReopen_…` **Live flows (worker, `with-slot.sh`, headless Chromium):** | flow | this branch | control `origin/dev` | |---|---|---| | M metrics PUT with `id`/`partitionKey`/`rowKey`/`timestamp`/`eTag` in the body (#195.7) | PASS: both saves 200; read back `partitionKey` `Metrics` and `rowKey` the Event; a hostile key set is ignored; one raw Azurite row | PASS (same checks) | | B1 metrics field with an invalid count (#195.6) | PASS: input name `Attendees must be a whole number from 0 to 1000000.`, invalid=true | FAIL: input name `Attendees`, description empty, invalid=true (the describedby does not cross the shadow root) | | B2 Comment typed, Select Winner, Discard while the metrics PUT is held (#195.5) | PASS: Discard disabled=true, the question is held open; after the PUT, Discard saves the Winner (stored: Second) | FAIL: Discard enabled; clicking it closes the question with no Winner saved (stored: First), as the card expected on `dev` | | B3 repo E2E suite | PASS 7 of 7 | PASS 7 of 7 | Chromium accessibility tree for B1, verbatim (CDP `Accessibility.getFullAXTree`): - branch: `[{"name":"New Comment","description":"","invalid":"false"},{"name":"Attendees must be a whole number from 0 to 1000000.","description":"","invalid":"true"},{"name":"New attendees",...}]` - control: `[{"name":"New Comment","description":"","invalid":"false"},{"name":"Attendees","description":"","invalid":"true"},{"name":"New attendees",...}]` - On both, the tree holds a single alert, `{"role":"alert","name":"","live":"assertive"}`: the message's own live region. No second alert carries the message. ## Dispositions - #195.1 DONE: comments corrected, shared Discard wording, `OverDialog` describes its own contract only - #195.2 DONE: 4 new wiring tests; the mutated lines are W1 to W6 above - #195.3 DONE: metrics-intact test can fail (P6), the in-flight save reaches `_saving` (P5), no private `SelectWinner` call - #195.4 DONE: `DataRow` table with literal limits, `+` and unreadable text, no reflection; the Web-only message for unreadable text is kept - #195.5 DONE: Discard disabled and held while `Busy`, then it saves (needed `ConfirmDialog.razor`, see Deviation) - #195.6 DONE: fixed locally in `EventMetricsForm.razor` via `aria-label`; browser output above; no shared component - #195.7 DONE: no code change; M on the branch and M on `dev` both PASS - #195.8 DONE (with the two declines below): `PageActions.cs` in the files this card owns, one Discard wording, `var f` gone, `Metric` pairs, `EventMetricsRules` internal - `EventMetricsRules.Count`/`.Money` DECLINED as the card says: the Web copy of `FieldRules` is deliberate, because the API's class is internal - `EventMetricsField` abstract base DECLINED, not prototyped: a single non-generic class would need the int and decimal parse, format and rule passed as delegates over boxed values, which I judged no shorter - #195.9 DONE: three files split, each part under 400 lines - #195.10 OUTSIDE: wave 2 card (the `LoadAllAsync` callers) - #196.7 by test: - DONE `CancelButton_IsIgnoredWhileSaveInFlight`: runs Cancel's own handler (P8 red) - DONE `SaveFinishingAfterCancelAndReopen_…`: `_edit` is now read through the page (the newer dialog's own save goes to Brawl; P9 red) - DECLINED for `CloseForm`/`CloseCustomize`, and for the two new wiring tests' `CloseCustomize`/`CloseDetails`: no page event can close a dialog while its save runs (Cancel, Escape and the overlay all wait), and that close is exactly the case under test, so it stays a commented reflection call in one helper - #196.1 to .6 and .8 to .15 OUTSIDE: Library card - #200.9 DONE in this card's files (`Normalize`, `Stored` → `StoredComment`, `OpenDetails` now one copy per fixture, `RowButton`/`Dismiss`/`Pick`); `CommentsPanelTests`, `ActivityDetailsDialogTests`, `AccessibleNamesTests` OUTSIDE: wave 2 - #200.10 DONE in `CommentsFromEventDetailsTests` (the unused using is gone); `CommentsPanelTests` OUTSIDE: wave 2 - #200.1, #200.2 OUTSIDE: last card - #200.3, #200.4 DECLINED: in the issue - #200.5 to .8 and .11 to .19 OUTSIDE: wave 2 ## Notes - `Refs #195, #196, #200, #205`, not `Closes`: Nerd closes the issues by hand once every item has a disposition. Not merged. - Observations, not fixed here: - `EditEventSnapshotTests.cs:176` still writes `System.Net.HttpStatusCode` in full (#200.18, wave 2). - The other ~8 copies of `RowButton`/`Dismiss` in files this card does not own can now move to `PageActions` (wave 2).
mwg-bender Bot
added a commit
that referenced
this pull request
Nov 23, 2026
## Summary Closes the follow-ups of #193 on the E2E project (spec #205), and splits `BrowserSession` into the session, an API seed client and a page-traffic class. Only `MW-GC.EventManager.E2ETests/**` changes. ## Change - **Split (#193.7).** `BrowserSession` now covers lifecycle, sign-in and navigation, and holds `Button()` and `Dialog()`. `ApiSeedClient` does the seeding, the reads and the children-first delete; `DeleteGameAndActivitiesAsync` lives there and knows the API's delete rules. `PageTraffic` tracks and holds the page's requests. `CleanupStack` and `FlowOutcome` handle cleanup and reporting. Flows still use one `using static BrowserSession` entry. - **Leaks (#193.11).** `StartAsync` closes Playwright and the browser if a later step (such as sign-in) throws. Every cleanup step runs even when one throws. When the flow fails, its own exception stays first in the aggregate. An inconclusive flow is never wrapped in an `AggregateException`: with no cleanup failure it is rethrown as it is, and with a cleanup failure it becomes an `AssertFailedException` whose inner exception is the inconclusive one. - **Idle wait (#193.2).** `WaitForActionToSettleAsync(mark, action)` first waits for a request started after the mark, with a timeout and a failure that names the action, and only then waits for idle. - **Timeouts and retries (#193.3, #193.4).** One `UiTimeoutMs` (30 s) is passed to every `Expect`. `Expect(...).ToBeDisabledAsync()` replaces the single `IsDisabledAsync()` read. - **Delete guard (#193.1, #193.5, #193.6, #193.8).** One `DeleteGuard.AssertHeldAsync` drives every Delete-guard flow. It returns one verdict that names the request count, the question count and the disabled state. - New: the Games, Themes and Holidays Delete flows, as one `DataRow` test. - New: `ClickBeforeTheBusyRender_OnConfirmedActivityDelete_SendsOneRequest`, which clicks the row's Delete inside Confirm's own browser task, from within the page's DELETE `fetch`, and checks that the row was still enabled when it clicked. - `RapidSecondClick_OnConfirmedEventDelete_SendsOneRequest` now uses the same technique. - The Duplicate flow finds its button by name instead of a saved screen position. - **Typed values (#193.9, #193.10, #193.12).** Seed bodies and answers are small records, and methods are `HttpMethod`. `OnCleanup` and `AppUrl` are gone, and `GetStatusAsync` is `internal`. `SmokeTests` uses `using static`. - **Question counter (#193.14).** It matches dialogs by `role=dialog`, including inside the Fluent shadow root, and has no tag-name fallback: the role match counted every question in the live runs. ## Validation All runs are by the worker (Nerd's dispatched Kanban worker), on base `dev` 617f4a4. **Build and tests (cold, `clean-build.sh`, whole solution)** | | errors | warnings | Api.Tests | Web.Tests | E2E (no stack) | |---|---|---|---|---|---| | dev 617f4a4 | 0 | 0 | 589 + 4 skipped | 727 | 7 inconclusive | | this branch | 0 | 0 | 589 + 4 skipped | 727 | 5 passed, 12 inconclusive | The card quoted Api.Tests as 495+4, measured on dev 2730911. #208 (Series, merged into dev 617f4a4) added 94 Api tests, so 589+4 is the unchanged figure on this base. Api.Tests and Web.Tests are unchanged by this PR. **E2E on the full stack (`with-slot.sh`: Azurite, API, Release web build behind SWA)** - Plain `origin/dev` 617f4a4: **7 of 7** passed. - This branch: **17 of 17** passed, run after the last edit. - Count: 7 kept with the same names, plus 1 (item 1), 0 (item 5, rewritten), 3 (item 6, Games, Themes and Holidays), 2 (item 2) and 4 (item 11) = 17. **Mutation proofs (throwaway copies; nothing below is committed)** | Mutation | Run on | Result | |---|---|---| | #193.2: settle wait skips the wait for the first request | E2E unit test | RED: `WaitForActionToSettle_WhenTheActionHasSentNoRequestYet_FailsNamingTheAction` | | #193.11: `StartAsync` keeps no cleanup on a failed start | E2E | RED: `Start_WhenSignInThrows_ClosesTheBrowserItStarted` | | #193.11: cleanup stops at the first failure | E2E | RED: `Cleanup_RunsEveryStepNewestFirst_EvenWhenOneFails` | | #193.11: cleanup failure placed before the flow's failure | E2E | RED: `Outcome_FlowAndCleanupBothFailed_KeepsTheFlowsFailureFirst` | | #193.11: inconclusive plus cleanup failure becomes `AggregateException` | E2E | RED: `Outcome_InconclusiveFlow_IsNeverWrappedInAnAggregate` | | #193.1: `Disabled` removed from every row Delete (`EventList.razor`, `LibraryPage.razor`) | E2E `Name~Delete` | RED: 6 of 6 Delete-guard flows fail, including `ClickBeforeTheBusyRender_…` | | #193.1: handler guard and `Disabled` both removed | E2E `Name~Delete` | RED: 6 of 6 Delete-guard flows fail | | #193.1: **handler guard only** removed (`Events.razor` and `LibraryPage.razor` `AskDelete`) | E2E `Name~Delete` | **GREEN, 7 of 7: not caught** | | same handler-guard-only mutant | Web.Tests (bUnit) | **GREEN, 727 of 727: not caught** | **Item 1 is not fully proven, and this is a known gap.** The flow fails when only `Disabled` is removed. It does **not** fail when only the handler guard is removed, and no test in the repo does. Probes on a traced mutant explain why a real browser cannot reach the handler past the busy render: - Once Confirm's `click()` returns, Blazor has already rendered the row's `disabled` attribute synchronously inside the dispatch. - A click issued from inside the page's own DELETE `fetch` sees the row still enabled. Blazor queues that click until after the busy render, and then `FluentButton` (4.14.4, `if (!Disabled && OnClick.HasDelegate)`) drops it. So the "fails if only the handler guard is removed" half of item 1 cannot be shown from a DOM click path. Closing it needs a bUnit test that invokes the Delete handler directly while a delete runs, the way `Duplicate_DoubleClick_SendsOneRequest` does for Duplicate. That belongs to a Web.Tests card; see Notes. ## Notes - `Refs #193, #205`. Nerd closes the issues by hand once every item has a disposition. #193.13 is declined. - Observation, out of scope for this card: no Web.Tests test catches removing the `AskDelete` handler guard in `Events.razor` or `LibraryPage.razor`. `LibraryPageTests.Delete_ASecondClickWhileTheFirstIsInFlight_SendsNothing` clicks the disabled button, which `FluentButton` already drops. A follow-up should invoke the captured `OnClick` past its disabled state, as `DialogSafetyTests.Duplicate_DoubleClick_SendsOneRequest` does. - Not merged; base is `dev`.
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
Part 1 of the recurring Events spec (#204, covers #100): the pure Occurrence generator in Shared that the later parts (storage, routes, daily timer, UI) build on, plus ADR 0002. Nothing existing changes: no storage, routes, UI,
.csproj,GLOSSARY.mdor.github/, and no new package reference in Shared.Change
New files only, in namespace
MW_GC.EventManager.Shared.Series:OccurrenceGenerator.Generate(RecurrenceSeries series, DateTimeOffset now, IReadOnlyCollection<DateTimeOffset> existing, IReadOnlyCollection<DateTimeOffset> skipped)returns the instants of the Occurrences to create now, in order. That means every rule date frommax(first instant, now)up to and includingnow + 8 weeks, plus the first rule date afternoweven when it is further out. Nothing beforenow. Existing and skipped instants are never returned, and a skipped date does not count as the next one. Keys compare as instants, whatever offset they are written in. No clock, no I/O, no randomness, and noTimeZoneInfo.RecurrenceSeries(First, Rule)is a plain record.RecurrenceRulewithRecurrenceKind: Weekly, BiWeekly, MonthlyNthWeekday(WeekOfMonthFirst..Fourth or Last,DayOfWeek), MonthlySameDate, AnnualSameDate, AnnualHoliday(HolidayPreset).HolidayPresets: an in-house table, one row per preset, with no external call. It holds New Year's Day, MLK Jr. Day, Valentine's Day, Presidents' Day, St. Patrick's Day, Earth Day, Easter Sunday (anonymous Gregorian algorithm, Meeus/Jones/Butcher), Mother's Day, Memorial Day, Father's Day, Independence Day, Labor Day, Columbus/Indigenous Peoples' Day, Halloween, Thanksgiving, Christmas Eve, Christmas and New Year's Eve. This is the card's list plus the spec's extra fixed dates.RecurrenceRule.Validate()returns a message or null: an unknown rule kind, a week outside First..Fourth/Last, a weekday that is not a day of the week, or an unknown preset. The generator throwsArgumentExceptionwith that message.docs/adr/0002-recurring-events-are-a-series-that-materialises-occurrences.mdrecords the Series and Occurrence model: materialised Event rows, zero Selections until rolled, the slot template, instants with accepted drift, the daily timer with no HTTP surface, edit and cancel scopes, Modified and the bot rename, and the in-house preset table.Validation
All numbers come from cold builds (bin/obj deleted,
--no-incremental) on baseorigin/dev2730911 (it did not move) and on head 7c33315:The change adds 94 tests in
MW-GC.EventManager.Api.Tests/Series/and removes, renames or changes none. Every expected value is a literal date. The four skipped tests are the Azurite tests, which skip withoutEM_AZURITE_CONNECTION, as on base.Validatecame first, and mutations prove those below. The run step then found a real bug: whennowfell exactly on a rule date, that date counted as "the first after now". A new test went red first (A_rule_date_exactly_at_now_is_not_the_next_one_after_now) and then the code was fixed.>turned into>=(1), the at-least-one rule removed (10), a rule date at now counted as the next one (1), weekly following New York's time zone (12), calendar rules at UTC (20), the bi-weekly phase, skipped ignored or counted, existing ignored, keys compared by wall clock, Halloween and Thanksgiving rows wrong, a missing table row, and each validation check removed.dateutil.easterfor Easter and plaindatetime/calendarfor everything else. For 2026 to 2060, 18 of 18 presets PASS. The next 12 Occurrences of 8 sample rules all PASS: weekly, bi-weekly, 2nd Thursday, last Friday, the 31st, 29 February, Easter and Thanksgiving. There were 0 FAIL lines.Notes
Refs #100, #204. Nerd closes the issues by hand once every part of spec(0.6.0): recurring Events as a Series that generates Occurrences #204 lands.HolidayPresetnames a date rule and is distinct from the Holiday tag on Activities; ADR 0002 says so.