fix(projections): reject transient projection posts#425
Conversation
yordis
commented
Jul 7, 2026
- Transient query-style projections keep legacy runtime behavior inside the core projection surface.
- A single management boundary keeps public APIs consistent without carrying an unsupported query path forward.
PR SummaryMedium Risk Overview Tests and gRPC parity are aligned: new/updated manager tests expect failure and Comment-only tweaks in checkpoint/reader code clarify behavior unrelated to the new rejection policy. Reviewed by Cursor Bugbot for commit 042838b. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughTransient projection posts are now rejected immediately with an operation-failed response. The related tests now assert rejection, NotFound query behavior, and skip transient query projection scenarios. ChangesTransient Projection Rejection
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ProjectionManager
participant ProjectionStore
Client->>ProjectionManager: Post(ProjectionMode.Transient)
ProjectionManager-->>Client: OperationFailed("Transient projections are not supported.")
Client->>ProjectionManager: GetQuery(projectionName)
ProjectionManager->>ProjectionStore: lookup projection
ProjectionStore-->>ProjectionManager: not found
ProjectionManager-->>Client: NotFound
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/EventStore.Projections.Core.Tests/Services/projections_manager/runas/when_posting_a_transient_projection.cs (1)
49-67: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider renaming for clarity.
Behavior is correct, but
projection_owner_cannot_retrieve_projection_queryimplies an authorization failure. The actual reason is that the projection was never created (Post is now rejected upfront). The sibling fixture'sthe_projection_is_not_registeredname reflects this more accurately.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/EventStore.Projections.Core.Tests/Services/projections_manager/runas/when_posting_a_transient_projection.cs` around lines 49 - 67, Rename the test method projection_owner_cannot_retrieve_projection_query in when_posting_a_transient_projection to better reflect that the projection is never created, not that access is denied. Keep the behavior unchanged, but align the name with the sibling fixture’s phrasing like the_projection_is_not_registered so the intent matches the OperationFailed/GetQuery flow.src/EventStore.Projections.Core.Tests/Services/grpc_service/ProjectionManagementParityTests.cs (1)
215-220: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueExclusion test no longer exercises real filtering.
all_non_transient_statistics_excludes_transient_projectionschecks thatTransientProjectionNameis absent from_allNonTransientStatistics. Since the transient projection is now never created (creation always fails per this PR), this assertion is trivially true regardless of whetherAllNonTransientactually filters transient projections — it no longer verifies the filtering behavior it appears intended to test.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/EventStore.Projections.Core.Tests/Services/grpc_service/ProjectionManagementParityTests.cs` around lines 215 - 220, The `all_non_transient_statistics_excludes_transient_projections` test no longer proves `AllNonTransient` filtering because `TransientProjectionName` is never actually created. Update the parity test setup in `ProjectionManagementParityTests` so a real transient projection is created and included in the statistics source before querying `_allNonTransientStatistics`, then keep the assertion on `TransientProjectionName` to verify the filtering behavior exercised by `AllNonTransient`.src/EventStore.Projections.Core/Services/Management/ProjectionManager.cs (1)
1226-1232: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
PostNewTransientProjectionis now dead code.With
Handle(Post)rejectingProjectionMode.Transientbefore constructing aPendingProjection, this private method has no remaining call sites in the file (it's private, so no external callers are possible). Consider removing it.♻️ Proposed removal
- private void PostNewTransientProjection(PendingProjection projection, IEnvelope replyEnvelope) - { - var initializer = projection.CreateInitializer(replyEnvelope); - ReadProjectionPossibleStream(projection.Name, - m => ReadProjectionPossibleStreamCompleted - (m, initializer, replyEnvelope)); - } -🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/EventStore.Projections.Core/Services/Management/ProjectionManager.cs` around lines 1226 - 1232, `PostNewTransientProjection` in `ProjectionManager` is now unreachable because `Handle(Post)` rejects `ProjectionMode.Transient` before any `PendingProjection` is created. Remove this private helper and any now-unused related code paths so the class no longer contains dead code.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@src/EventStore.Projections.Core.Tests/Services/grpc_service/ProjectionManagementParityTests.cs`:
- Around line 215-220: The
`all_non_transient_statistics_excludes_transient_projections` test no longer
proves `AllNonTransient` filtering because `TransientProjectionName` is never
actually created. Update the parity test setup in
`ProjectionManagementParityTests` so a real transient projection is created and
included in the statistics source before querying `_allNonTransientStatistics`,
then keep the assertion on `TransientProjectionName` to verify the filtering
behavior exercised by `AllNonTransient`.
In
`@src/EventStore.Projections.Core.Tests/Services/projections_manager/runas/when_posting_a_transient_projection.cs`:
- Around line 49-67: Rename the test method
projection_owner_cannot_retrieve_projection_query in
when_posting_a_transient_projection to better reflect that the projection is
never created, not that access is denied. Keep the behavior unchanged, but align
the name with the sibling fixture’s phrasing like
the_projection_is_not_registered so the intent matches the
OperationFailed/GetQuery flow.
In `@src/EventStore.Projections.Core/Services/Management/ProjectionManager.cs`:
- Around line 1226-1232: `PostNewTransientProjection` in `ProjectionManager` is
now unreachable because `Handle(Post)` rejects `ProjectionMode.Transient` before
any `PendingProjection` is created. Remove this private helper and any
now-unused related code paths so the class no longer contains dead code.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a814126d-5fc4-478d-beb0-43cdf8298a81
📒 Files selected for processing (4)
src/EventStore.Projections.Core.Tests/Services/grpc_service/ProjectionManagementParityTests.cssrc/EventStore.Projections.Core.Tests/Services/projections_manager/runas/when_posting_a_transient_projection.cssrc/EventStore.Projections.Core.Tests/Services/projections_manager/when_posting_a_transient_projection.cssrc/EventStore.Projections.Core/Services/Management/ProjectionManager.cs
1bd5d21 to
e470aa4
Compare
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
e470aa4 to
042838b
Compare