Skip to content

Remove redundant DeleteMessages(StoredId, positions) IMessageStore overload#174

Merged
stidsborg merged 2 commits into
mainfrom
remove-storedid-deletemessages-overload
Jun 20, 2026
Merged

Remove redundant DeleteMessages(StoredId, positions) IMessageStore overload#174
stidsborg merged 2 commits into
mainfrom
remove-storedid-deletemessages-overload

Conversation

@stidsborg

@stidsborg stidsborg commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

Removes Task DeleteMessages(StoredId storedId, IEnumerable<long> positions) from IMessageStore. Message positions are globally-unique identity values, so the StoredId filter was redundant — the positions-only overload DeleteMessages(IReadOnlyList<long> positions) covers the same need.

  • ExistingMessages.Remove (the sole production caller) now routes through the positions-only overload.
  • The two-arg overload is removed from the interface, all four store implementations (InMemoryFunctionStore, PostgreSqlMessageStore, MariaDbMessageStore, SqlServerMessageStore), and the now-orphaned SqlGenerator.DeleteMessages(StoredId, …) in the PostgreSQL/MariaDB/SqlServer generators.

Tests

  • The shared message-store test templates are migrated to the positions-only overload. Method names are unchanged, so the per-store override files needed no edits. This is a net coverage gain — the positions-only overload previously only had in-memory coverage (via MessageClearer) and is now exercised across all stores.
  • DeleteMessagesWithNonExistentPositionsDoesNotThrow was reworked to delete a real, already-removed position rather than a hardcoded 999/1000; without the StoredId filter an arbitrary number could collide with another flow's globally-unique position in a shared database.
  • Dropped the throwing stub for the removed method from the ControllableMessageStore test double.

Verification

  • ✅ Full solution builds clean (0 warnings, 0 errors)
  • ✅ In-memory DeleteMessages* + MessageClearer: 10/10
  • ✅ PostgreSQL DeleteMessages*: 5/5
  • ✅ MariaDB DeleteMessages*: 5/5
  • ✅ SqlServer DeleteMessages*: 5/5

🤖 Generated with Claude Code

Also: flaky test fix (unrelated)

CI surfaced a pre-existing flaky test, PostponingExistingFunctionFromControlPanelSucceeds, while this PR was in review. It postponed to new DateTime(1_000_000) — a year-0001 timestamp that is already expired — so the PostponedWatchdog could resume the function and flip its status Postponed → Executing before the assertions ran. Fixed by postponing to a future timestamp (DateTime.UtcNow.AddDays(1)), matching the sibling PostponingExistingActionFromControlPanelSucceeds test. Not related to the DeleteMessages change, but included here since it was blocking this PR's CI.

…erload

Message positions are globally-unique identity values, so the StoredId
filter was redundant. ExistingMessages.Remove now routes through the
positions-only DeleteMessages overload, and the two-arg overload is
removed from the interface, all four store implementations, and the
PostgreSQL/MariaDB/SqlServer SQL generators.

The shared message-store test templates are migrated to the positions-only
overload (method names unchanged, so per-store override files are
untouched), giving that overload cross-store coverage it previously lacked.
The test postponed to new DateTime(1_000_000) - a year-0001 timestamp that
is already expired - so the PostponedWatchdog could resume the function and
flip its status from Postponed to Executing before the assertions ran. Postpone
to a future timestamp (DateTime.UtcNow.AddDays(1)) instead, matching the sibling
PostponingExistingActionFromControlPanelSucceeds test, which closes the race.
@stidsborg stidsborg merged commit d43aa95 into main Jun 20, 2026
8 checks passed
@stidsborg stidsborg deleted the remove-storedid-deletemessages-overload branch June 20, 2026 09:50
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.

1 participant