fix: member attributes should have non empty values and a filled default#3449
fix: member attributes should have non empty values and a filled default#3449
Conversation
|
Hey @themarolt @skwowet. Shouldn't this be merged? If it was done 3 months ago, maybe the work has already been overridden? Or is this not needed anymore? |
|
@joanagmaia this should be merged, if I’m not mistaken. I think it came from one of the support tickets (trying to remember which one..) |
|
@themarolt pinging once again on this one, should this be merged or closed? |
Oh damn - I totally forgot about this one - let me merge |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull request overview
This PR aims to ensure member attribute “default” values are derived from a non-empty platform value (based on platform priority), and adjusts the data sink worker to pass PlatformType through the member/attribute validation pipeline. It also adds a one-off script to backfill/fix existing members with missing attribute defaults.
Changes:
- Update shared
setAttributesDefaultValueslogic to ignore empty/blank platform values when choosing the default. - Reorder/propagate
PlatformTypethroughMemberAttributeService.validateAttributesandMemberServicecreate/update flows. - Add a
fix-member-attributes.tsscript to patch existing DB records with emptydefaultattribute values.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/libs/common/src/member.ts | Filters attribute platforms to non-empty values before selecting the default. |
| services/apps/data_sink_worker/src/service/memberAttribute.service.ts | Reorders validateAttributes params to accept platform first. |
| services/apps/data_sink_worker/src/service/member.service.ts | Changes create/update signatures and call sites to use PlatformType (instead of source: string). |
| services/apps/data_sink_worker/src/service/activity.service.ts | Updates member creation call to satisfy new PlatformType signature (currently via cast). |
| services/apps/data_sink_worker/src/bin/fix-member-attributes.ts | New batch script to find and fix members with empty attribute defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
…utes Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
c65b63c to
b444f81
Compare
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Signed-off-by: Uroš Marolt <uros@marolt.me>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |

Changes proposed ✍️
What
copilot:summary
copilot:poem
Why
How
copilot:walkthrough
Checklist ✅
Feature,Improvement, orBug.Note
Medium Risk
Introduces a batch script that directly updates
members.attributesin production and changes how attribute defaults are derived, which could affect large numbers of records if the selection/merge logic is wrong.Overview
Fixes member attribute normalization so
defaultvalues are only derived from non-empty per-platform values; attributes with no non-empty platform values are removed.Adds a new
fix-member-attributesworker script to backfill existing members whose attributes have emptydefaultvalues despite having non-empty platform values, while preserving manually changed attribute keys and updating members in batches.Tightens types and call signatures around member creation/updating by consistently passing
PlatformTypeintoMemberService/MemberAttributeService.validateAttributes(instead of a genericsourcestring).Written by Cursor Bugbot for commit b2520da. This will update automatically on new commits. Configure here.