Repository navigation
Conversation
#4390's moderator-close test mocked messageRepo.update, but #4421 (merged separately) made closeCard write through updateIfLive, so the test's write returned undefined and closeCard threw 'Cannot close a deleted poll'. api-tests has been red on main since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D7R7NNPw2Kpjnca1FFPvfH
4 of 5 tasks
|
Base-branch sync — If you are the agent session watching this PR, resolve them now:
Automated wake signal from |
Owner
Author
|
Closing: Generated by Claude Code |
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
api-testsis red onmain, and so on every open PR. The failing test isPollService › close › a chat-card poll › lets a moderator close an open-ended card whose creator can no longer close it, keeping the tally (#4046), which throwsBadRequestException: Cannot close a deleted poll.Two PRs collided:
messageRepo.update.closeCardwrite throughupdateIfLive, so that a delete landing mid-close isn't overwritten (Deleting a chat message clearscontentandmetadatabut leavespayload, so a deleted card's data is still served #1575).In the test,
updateIfLivereturns nothing, so the close reads as "deleted".The fix mocks and asserts
updateIfLive, as every other card-path test in the file already does. The REST-shape moderator test keepsupdate, which is right because the REST path still writes through it. Nothing else changes.Found while babysitting #4445, which this unblocks. Asked by: Shawn, 2026-11-12, as part of #3774's work (coordinator chat on Paul's second account).
Changes
apps/api/src/application/services/poll.service.spec.ts: one test's mock and its assertion.Docs / Spec impact
Test plan
main(304501b):npx jest src/application/services/poll.service.spec.tsgives 1 failed, 78 passed.api-testsgreen./diff-review: one finder ran over the 5-line diff and found nothing. That is a smaller round than the full workflow, because the change is test-only.Release label
release:patchDebt spotted
None found.
Generated by Claude Code