Skip to content

fix(properties): include team Deal Stage values in the bulk loader - #6270

Merged
ptaranat merged 1 commit into
mainfrom
fix/soup-team-stage-values
Sep 8, 2026
Merged

fix(properties): include team Deal Stage values in the bulk loader#6270
ptaranat merged 1 commit into
mainfrom
fix/soup-team-stage-values

Conversation

@ptaranat

@ptaranat ptaranat commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

CRM Stage moves on a customized team were lost on refresh. The property loader behind soup and search only returned system properties and tags, so values on the team's Deal Stage definition never reached the board and the company cards fell back to the old system Stage.

The loader now also returns the viewer's team Deal Stage definition.

Found while testing #6244 which would be unblocked by this.


Note

Medium Risk
Changes shared bulk property loading for Soup/CRM cards with team-based filtering; incorrect scoping could leak or hide stage data across teams.

Overview
Fixes custom CRM deal stages disappearing after refresh by extending the bulk filtered property read path used by Soup/search.

When a viewer user id is present, get_bulk_entity_properties_values_filtered now returns the viewer’s team Deal Stage definition (non-system, single-select SELECT_STRING named CRM_TEAM_STAGE_DEFINITION_NAME), in addition to requested ids and visible TAG definitions. Matching is team-scoped via team_user, so users only see their team’s pipeline—not another team’s stage on the same company.

CRM_TEAM_STAGE_DEFINITION_NAME ("Deal Stage") moves to the properties crate and is re-exported for CRM. The sqlx snapshot for this query is regenerated; integration coverage uses a new team_stage fixture.

Reviewed by Cursor Bugbot for commit 991c540. Bugbot is set up for automated code reviews on this repo. Configure here.

The loader behind soup and search only returned system properties and tags.
A customized team stores stage values on its own Deal Stage definition, so
every board reload lost them. Return that definition too.
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6fe99cce-5c8a-4bb5-a704-67126ff87e72

📥 Commits

Reviewing files that changed from the base of the PR and between b1108fc and 991c540.

⛔ Files ignored due to path filters (2)
  • .sqlx/query-9d1892f8bb8ba65131fa035ffe3e79f932f8668dd7dce998e2a885bcaf0d8bbf.json is excluded by !**/.sqlx/**
  • .sqlx/query-b68293cb0a18d2274fade4859e0ddcaf7352f2c8e7409d8eb3565cdeabb4fe6a.json is excluded by !**/.sqlx/**
📒 Files selected for processing (7)
  • crates/crm/src/domain/stages.rs
  • crates/properties/fixtures/team_stage.sql
  • crates/properties/src/domain/model.rs
  • crates/properties/src/lib.rs
  • crates/properties/src/outbound/entity_properties_get_query.rs
  • crates/properties/src/outbound/entity_properties_values_test.rs
  • crates/soup/src/outbound/pg_soup_repo.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • CRM property results now include the viewer’s team-specific Deal Stage definition.
    • Deal Stage values are scoped to the viewer’s team, helping prevent visibility of other teams’ stage data.
    • Explicitly requested properties continue to be returned alongside the team-specific Deal Stage.
    • Deal Stage options, such as Lead, Customer, and Prospect, are included with the returned property.

Walkthrough

The properties crate now defines and re-exports the canonical CRM team stage name. The CRM crate re-exports the same constant. Filtered bulk property queries now include the viewer’s team CRM stage definition when the viewer is present. Fixtures and integration tests cover team-specific visibility, property options, explicit property requests, and missing viewers. A soup repository comment documents the expanded lookup behavior.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 991c5

Bulk property loading now preserves each viewer’s team-specific Deal Stage during company-card refreshes. The team-scoped lookup and covered edge cases indicate the change is ready to merge.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the CRM Deal Stage refresh issue and the bulk loader change that resolves it.
Title check ✅ Passed The title follows Conventional Commits format with the fix(properties): prefix, describes the main change, and is 66 characters long.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seanaye seanaye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes seem fine but I'm not super familiar with CRM

@ptaranat

ptaranat commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Code changes seem fine but I'm not super familiar with CRM

@seanaye thx for stamp. I requested your review as it's mostly changes in the shared property loader that soup and search calls.
The only CRM-specific stuff is to match the team's definition the same way the CRM crate already does it.
Gonna squash.

@ptaranat
ptaranat merged commit 02c4ad7 into main Sep 8, 2026
30 checks passed
@ptaranat
ptaranat deleted the fix/soup-team-stage-values branch September 8, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants